css custom property fallback 'unset' not working as expected
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox118 | --- | fixed |
People
(Reporter: hello, Assigned: emilio)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0
Steps to reproduce:
Following HTML/CSS:
<body>
<style>
.outer {
--background: red;
}
.inner {
--background: var(--background-no, unset);
}
input {
background: var(--background);
}
</style>
<div class="outer">
<div class="inner">
<input />
</div>
</div>
</body>
Actual results:
Background of the input isn't changed.
Expected results:
Background of the input should be red.
Apparently using 'unset' as a fallback for a missing custom property doesn't work as expected. If you put --background: unset
on .inner, --background
will have the value set at .outer. This is expected behaviour I think. When using "unset" as a fallback, --background is not inherited from .outer.
Comment 1•11 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•11 months ago
|
||
The severity field is not set for this bug.
:emilio, could you have a look please?
For more information, please visit BugBot documentation.
Assignee | ||
Comment 3•11 months ago
|
||
Assignee | ||
Updated•11 months ago
|
Assignee | ||
Comment 4•11 months ago
|
||
So for unset
and so it is reasonable to behave like a non-custom property. However, not sure what it means for revert/revert-layer...
Assignee | ||
Comment 5•11 months ago
|
||
Assignee | ||
Comment 6•11 months ago
|
||
See spec issue for what to do about revert / revert-layer.
Updated•11 months ago
|
Assignee | ||
Updated•11 months ago
|
Assignee | ||
Updated•11 months ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cce73ea72723 Deal with wide keyword fallbacks after substitution. r=zrhoffman
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41363 for changes under testing/web-platform/tests
Comment 10•11 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•