Closed Bug 1843783 Opened 11 months ago Closed 11 months ago

css custom property fallback 'unset' not working as expected

Categories

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

Firefox 116
defect

Tracking

()

RESOLVED FIXED
118 Branch
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.

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.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

The severity field is not set for this bug.
:emilio, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Attached file Reduced test-case.

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

See spec issue for what to do about revert / revert-layer.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(emilio)
Duplicate of this bug: 1846700
Severity: -- → S3
Priority: -- → P3
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
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: