Open Bug 1652999 Opened 4 years ago Updated 4 years ago

css wide keywords work in variable fallback

Categories

(Core :: CSS Parsing and Computation, defect, P3)

78 Branch
Desktop
Windows 10
defect

Tracking

()

UNCONFIRMED

People

(Reporter: u635660, Unassigned)

References

Details

Attachments

(1 file)

Attached file test css.html

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

Component: Untriaged → DOM: Core & HTML
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → Desktop

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).

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
See Also: → 1544886

(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

Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Component: DOM: Core & HTML → CSS Parsing and Computation
Severity: -- → S3
Priority: -- → P3
Summary: css wide keywords bug → css wide keywords work in variable fallback
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: