Closed Bug 2071270 Opened 2 months ago Closed 2 months ago

[css-values-5] @container style query using var from attr() does not invalidate when number changes

Categories

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

Firefox 155
defect

Tracking

()

VERIFIED FIXED
158 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- unaffected
firefox156 --- wontfix
firefox157 --- verified
firefox158 --- verified

People

(Reporter: ahudson, Assigned: emilio)

References

Details

(Keywords: regressionwindow-wanted)

Attachments

(3 files, 2 external files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:158.0) Gecko/20100101 Firefox/158.0

Steps to reproduce:

  1. go to https://codepen.io/editor/bigandy/pen/01a08c44-57f9-76be-9759-92864ceb6fcc
  2. click on the button to update the data-count value set on the <ul>

Actual results:

The number updates but the styles do not update.

Expected results:

the styles should update so that on an odd count the colours should be red-green-red-green etc, on an even count the colours should be cyan-pink-cyan-pink etc

Not sure if this is relevant or not but when I add another @container style() query to the original demo code the @container style query is invalidated even though the new style query is not matched.

See this demo: https://codepen.io/editor/bigandy/pen/01a09056-20f4-7091-9cbd-6d6115125c81

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 2047198

:sukil, since you are the author of the regressor, bug 2047198, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(swarupukil1)

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
Blocks: css-attr
Severity: -- → S3
Priority: -- → P3

I think that what's going on is that we're not keeping track of the var reference in the style query properly

Flags: needinfo?(swarupukil1)
Blocks: container-style-queries
No longer blocks: css-attr
No longer regressed by: 2047198
Assignee: nobody → emilio
Status: NEW → ASSIGNED
QA Whiteboard: [qa-triage-done-c158/b157][qa-investig-needed-c158/b157]

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/62671 for changes under testing/web-platform/tests

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Incorrect styling in some dynamic cases.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: Relatively straight-forward fix.
  • String changes made/needed?: none
  • Is Android affected?: yes
Attachment #9642070 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Upstream PR merged by moz-wptsync-bot

Attachment #9642070 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triage-done-c158/b157][qa-investig-needed-c158/b157] → [qa-triage-done-c158/b157][qa-investig-needed-c158/b157][uplift][qa-ver-needed-c158/b157]

I've reproduced this issue using Firefox 157.0a1 (2026.08.30) on macOS 12.
Verified as fixed on the latest Nightly 158.0a1 (2026.09.15) and on Firefox 157.0b2 using build from treeherder, with Ubuntu 24, macOS 12 and Windows 11, where the issue no longer persists, now the count colors changes as expected.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c158/b157][qa-investig-needed-c158/b157][uplift][qa-ver-needed-c158/b157] → [qa-triage-done-c158/b157][qa-investig-needed-c158/b157][uplift][qa-ver-done-c158/b157]
Flags: qe-verify+
QA Contact: tzsoldos
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: