We should add support for hwb() colors defined in CSS Color 4 - https://drafts.csswg.org/css-color/#the-hwb-notation.
Created attachment 419174 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Created attachment 419175 [details] Patch
Don't be put off by the big patch size, most is the output of a wpt case.
Comment on attachment 419175 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419175&action=review > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:835 > + CSSParserTokenRange args = consumeFunction(range); auto? > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:888 > + return convertTo<SRGBA<uint8_t>>(toSRGBA(HWBA<float> { static_cast<float>(normalizedHue), static_cast<float>(nomalizedWhiteness), static_cast<float>(nomalizedBlackness), static_cast<float>(*alpha) })); I’m a little surprised a this: convertTo<SRGBA<uint8_t>>(toSRGBA(x)) I understand that we have to specify "uint8_t"; my surprise is that convertTo does not implicitly include the toSRGBA work.
Committed r272344: <https://trac.webkit.org/changeset/272344> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419175 [details].
<rdar://problem/73952934>
(In reply to Darin Adler from comment #5) > Comment on attachment 419175 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=419175&action=review > > > > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:888 > > + return convertTo<SRGBA<uint8_t>>(toSRGBA(HWBA<float> { static_cast<float>(normalizedHue), static_cast<float>(nomalizedWhiteness), static_cast<float>(nomalizedBlackness), static_cast<float>(*alpha) })); > > I’m a little surprised a this: > > convertTo<SRGBA<uint8_t>>(toSRGBA(x)) > > I understand that we have to specify "uint8_t"; my surprise is that > convertTo does not implicitly include the toSRGBA work. This is due to color space conversion (the toSRGBA()) and component type conversion (the convertTo<SRGBA<uint8_t>>()) being separate currently. My plan is to make them into one thing, tentatively using the convertTo<> naming.
(In reply to Sam Weinig from comment #8) > (In reply to Darin Adler from comment #5) > > Comment on attachment 419175 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=419175&action=review > > > > > > > Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:888 > > > + return convertTo<SRGBA<uint8_t>>(toSRGBA(HWBA<float> { static_cast<float>(normalizedHue), static_cast<float>(nomalizedWhiteness), static_cast<float>(nomalizedBlackness), static_cast<float>(*alpha) })); > > > > I’m a little surprised a this: > > > > convertTo<SRGBA<uint8_t>>(toSRGBA(x)) > > > > I understand that we have to specify "uint8_t"; my surprise is that > > convertTo does not implicitly include the toSRGBA work. > > This is due to color space conversion (the toSRGBA()) and component type > conversion (the convertTo<SRGBA<uint8_t>>()) being separate currently. > > My plan is to make them into one thing, tentatively using the convertTo<> > naming. This is resolved in https://bugs.webkit.org/show_bug.cgi?id=221443.