[webkit-reviews] review granted: [Bug 221881] Prepare for adding relative color support : [Attachment 420267] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 15 08:41:10 PST 2021


Darin Adler <darin at apple.com> has granted Sam Weinig <sam at webkit.org>'s request
for review:
Bug 221881: Prepare for adding relative color support
https://bugs.webkit.org/show_bug.cgi?id=221881

Attachment 420267: Patch

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




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 420267
  --> https://bugs.webkit.org/attachment.cgi?id=420267
Patch

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

> Source/WebCore/css/parser/CSSParser.cpp:120
> -    return CSSPropertyParserHelpers::consumeColorWorkerSafe(range,
HTMLStandardMode);
> +    return CSSPropertyParserHelpers::consumeColorWorkerSafe(range,
strictCSSParserContext());

Rationale for going from "standard mode" to "strict"?

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:699
> +	   return clampTo<double>(*alphaParameter, 0.0, 1.0);

Should not need the <double> here.

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:712
> +    if (auto number = consumeNumberRaw(range))
> +	   return *number;
> +
> +    return WTF::nullopt;

Doesn’t seem like we need an if here. Just a return.

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:723
> +enum class RGBComponentType {
> +    Number,
> +    Percentage
> +};

Looks better on a single line?

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:736
> +enum class RGBOrHSLSeparatorSyntax {
> +    Commas,
> +    WhitespaceSlash
> +};

Looks better on a single line?

> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:760
> +    if (auto alphaParameter = consumeNumberOrPercentDividedBy100Raw(args))
> +	   return *alphaParameter;
> +
> +    return WTF::nullopt;

Doesn’t seem like we need an if here. Just a return.

> Source/WebCore/editing/cocoa/DataDetection.mm:603
> +			   hsla.lightness = 50.0f;

How do you know you found all the places that depend on the old range?


More information about the webkit-reviews mailing list