LCH and LAB functions do not correctly handle the none keyword
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: rasmussen.bryan, Unassigned)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0
Steps to reproduce:
You can see the issue in this codepen https://codepen.io/bryanrasmussen/pen/MWMbYOr
Actual results:
lch and lab color functions with missing param behaved as if it was not syntactically correct (instead using the color of the parent)
lch and lab color functions with param none did not seem to get the correct hue interpolation - it seems like none makes a very dark text.
Expected results:
going by the text -
In certain cases, a color can have one or more missing color components.
In this specification, this happens automatically due to hue-based interpolation for some colors (such as white); other specifications can define additional situations in which components are automatically missing.
It can also be specified explicitly, by providing the keyword none for a component in a color function. All color functions (with the exception of those using the legacy color syntax) allow any of their components to be specified as none.
perhaps my opinion here is wrong but it seems to that FF has the wrong behavior - hue is not correctly interpolated also I believe it is always the same look when none is set for a param in the function.
FF's behavior with missing param is the same as Chrome and Safari (not sure if they still share rendering engine), so my interpretation of the spec as saying you should replace missing property with 0 is probably wrong, but in the case of none it seems to me that Safari and Chrome correctly handle the hue and FF is not handling the none keyword correctly.
Reporter | ||
Comment 1•6 months ago
|
||
oops sorry about the big text, I just copy pasted text from the spec.
Comment 2•6 months ago
|
||
Please move if this is not the right product/component.
Updated•6 months ago
|
Hello, Bryan
Could you please provide a screenshot or post a screen recording of the issue?
Reporter | ||
Comment 4•6 months ago
|
||
Note the 3rd line down in both Lab and LCH shows when keyword None is used, which from my understanding of spec should trigger hue interpolation and does not seem to.
The example where value is missing may be correct, I admit I have a bit trouble understanding what the spec says there, FF seems to treat it as a malformed value, and I think that might be wrong by the spec.
Reporter | ||
Comment 5•6 months ago
|
||
If you use the codepen in chrome and safari you can see that they seem to treat keyword None correctly and do hue interpolation, I have not created examples of None usage at all points in lch and lab usage, but from reading the spec it seems that you can also use None at those places and have it take the default color values.
so if you have lab(none,none, none) I guess that would be just whatever the current color was.
From intiial testing it seems FF does not handle "none" in any of the parameters of these functions, so I suppose the ticket is really about fixing that across the board, but I just gave the example of the third parameter being "none" because I thought it rather redundant to provide every possible example.
I would be looking around here https://www.w3.org/TR/css-color-4/#hue-interpolation and look for "none"
Updated•5 months ago
|
Updated•5 months ago
|
Description
•