Fix #14579: attribute selectors with trailing spaces after an unquoted value
(cherry picked from commit ed20e7c645064822f4070a0c60195e4bcdaba683)