Closed Bug 2017122 Opened 9 months ago Closed 8 months ago

@container style() queries fail to resolve when the custom property is defined in a separate <style> block or external CSS file.

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 149
defect

Tracking

()

RESOLVED DUPLICATE of bug 2014181

People

(Reporter: arby.dev.me, Unassigned)

Details

Steps to reproduce:

  1. Ensure layout.css.style-queries.enabled is true (standard in Nightly 149.0a1).
  2. Load the following markup:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <style>
    .parent { --variant: tonal; }
  </style>
  <style>
    .btn {
      background-color: red;
      @container style(--variant: tonal) {
        background-color: green;
      }
    }
  </style>
</head>
<body>
  <div class="parent">
    <button class="btn" type="button">Should be GREEN</button>
  </div>
</body>
</html>

Actual results:

The button background is red. The style query fails to detect the inherited custom property because it was defined in a different style block. (Note: Moving both rules into a single <style> tag fixes the issue).

Expected results:

The button should be green. The style query should resolve the computed value of the custom property regardless of which stylesheet defined it.

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

I think this was fixed by bug 2014181. Button is green on latest nightly. Thanks for the report tho!

Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Duplicate of bug: 2014181
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.