[webkit-reviews] review granted: [Bug 231052] Stop parsing context-sensitive colors in override-color : [Attachment 439954] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 4 20:52:14 PDT 2021


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 231052: Stop parsing context-sensitive colors in override-color
https://bugs.webkit.org/show_bug.cgi?id=231052

Attachment 439954: Patch

https://bugs.webkit.org/attachment.cgi?id=439954&action=review




--- Comment #4 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 439954
  --> https://bugs.webkit.org/attachment.cgi?id=439954
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439954&action=review

> Source/WebCore/css/StyleColor.cpp:54
> +    return (id >= CSSValueAqua && id <= CSSValueYellow) || (id >=
CSSValueAliceblue && id <= CSSValueYellowgreen) || id == CSSValueGrey || id ==
CSSValueAlpha || id == CSSValueTransparent;

We should make some helpers to contain these color range tests

> Source/WebCore/css/parser/CSSPropertyParserHelpers.h:118
> +enum class AcceptableColorSyntax : uint8_t {

Not sure I like "Acceptable" here. Might be nicer to just have:

enum class CSSColorType {
  Absolute = 1 << 0,
  Current = 1 << 1,
  System = 1 << 2,
};

consumeColor(CSSParserTokenRange&, const CSSParserContext&, bool
acceptQuirkyColors = false, OptionSet<CSSColorTypes> allowedColorTypes)


More information about the webkit-reviews mailing list