[css-color] HSL & HWB syntax should allow numbers as well as percentage.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: tlouw, Assigned: tlouw)
References
Details
Attachments
(2 files)
According to:
https://drafts.csswg.org/css-color-4/#the-hwb-notation
the HWB syntax allows percentages and numbers for the whiteness and blackness components:
hwb() = hwb(
[<hue> | none]
[<percentage> | <number> | none]
[<percentage> | <number> | none]
[ / [<alpha-value> | none] ]? )
Currently we only parse percentages for those components.
hwb(20deg 50 40) should be a valid hwb value. The color-valid-hwb.html wpt test doesn't test for these values either.
According to:
https://drafts.csswg.org/css-color-4/#the-hsl-notation
the modern HSL syntax allows percentages and numbers for the saturation and lightness components:
<modern-hsl-syntax> = hsl(
[<hue> | none]
[<percentage> | <number> | none]
[<percentage> | <number> | none]
[ / [<alpha-value> | none] ]? )
Currently we only parse percentages for the modern syntax.
hsl(20deg 50 40)
should be a valid hsl value. The color-valid-hsl.html
wpt test doesn't test for these values either.
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Comment 1•7 months ago
|
||
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 2•7 months ago
|
||
The second and third components for HSL and HWB are stored as
percentages in the range [0..1], but as part of the change to allow
numbers for those two components as well as percentages, they act like
all the other <number-or-percentage> components. This means the values
are store in their number value. For HSL and HWB they both match with
the percentage values and are in the range [0..100].
https://drafts.csswg.org/css-color-4/#the-hsl-notation
https://drafts.csswg.org/css-color-4/#the-hwb-notation
Change to the accepted types for the components are discussed here:
https://github.com/w3c/csswg-drafts/issues/8322
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Pushed by tlouw@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/23dfad39643a Change HSL and HWB to store components as numbers r=emilio,layout-reviewers
Pushed by tlouw@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf1b9592b97f HSL and HWB syntax should allow numbers as well as percentage r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43320 for changes under testing/web-platform/tests
Comment 7•7 months ago
|
||
bugherder |
Comment 8•7 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•