Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[image-set]
type()
function should only take one string
https://bugs.webkit.org/show_bug.cgi?id=256323 rdar://108909363 Reviewed by Tim Nguyen. Parsing for the image-set type() function is both too restricted and not strict enough. On the one hand, type( "image/png") (note the leading space) would be rejected while type("image/png" "image/png") would be accepted. This change fixes both issues by being a little more smart about handling the parser tokens passed to it and leaning on consumeString being able to handle leading and trailing whitespace tokens. We also need to be careful about not modifying the passed-in CSSParserTokenRange until after we've validated that the argument to type() was a single string. Otherwise we will hit an assert in the resolution calc() consumer. * LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-parsing-expected.txt: * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::ImageSetTypeCSSPrimitiveValueKnownTokenTypeFunctionConsumer::consume): Canonical link: https://commits.webkit.org/264310@main
- Loading branch information