css wide keywords work in variable fallback
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: u635660, Unassigned)
References
Details
Attachments
(1 file)
258 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Steps to reproduce:
FF share a bug where CSS-wide keywords are allowed in the fallback of a var() function
CSS-wide keywords are cascade-time instructions, and are not interpreted as such at computed-value time (when var()s are resolved).
Expected results:
it should not show the color red
Comment 1•4 years ago
|
||
This was changed intentionally in bug 1544886.
I don't think your reasoning is right. Variables are substituted and parsed right before value computation ("at computed value time"), but I don't think anything restricts the kind of values that you can declare.
Per that reasoning, --foo: inherit; background-color: var(--foo);
shouldn't work either, right? I don't see why fallback would be special there.
(Note that --foo: inherit
used not to work before bug 1544886 either, but it did work in other browsers).
Comment 2•4 years ago
|
||
(This appears to be a copy of my bug in Chromium).
Nope, it's not invalid. The behavior in this case is actually not defined. A reasonable behavior for "undefined" is for example "invalid at computed-value time", so I'd say it's the change that we (FF+Chrome) made that's somewhat invalid. Yay. :|
--foo: inherit
is notably different since it's actually handled by css-variables to be interpreted at cascade-time [1].
See also the original bug [2], and I filed a spec issue too [3].
[1] https://drafts.csswg.org/css-variables/#defining-variables
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=1105782
[3] https://github.com/w3c/csswg-drafts/issues/5325
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•