Closed Bug 1790652 Opened 2 years ago Closed 2 years ago

Container Query Condition Using Viewport-Relative Units Not Re-Evaluated When Viewport Size Changes

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox108 --- verified

People

(Reporter: dshin, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

STR: Load attached test case.
Expected: The small red div turns green after 1 second.
Actual: The small red div does not turn red, until inspecting the element, at which point it turns green.

See Also: → 1790495

I have a good sense of how to best fix this.

Assignee: nobody → emilio
Flags: needinfo?(emilio)
Severity: -- → S3

No behavior change but we're about to add some extra field to it.

No behavior change, but it makes more sense this way :)

Depends on D159850

This allows us to propagate flags from the container query styles all the
way to the computed style of the element.

The flag for viewport units in container queries has to be different
because it requires rematching, see comments.

Depends on D159851

By re-selector-matching the element (thus re-evaluating the container
query condition).

Depends on D159852

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1be0d212745c Make a wrapper struct for extra matching data. r=dshin https://hg.mozilla.org/integration/autoland/rev/7d531d105e7d Split in_media_query and in_container_query bits from computed::Context. r=dshin https://hg.mozilla.org/integration/autoland/rev/fd529aed43a1 Allow propagating computed style bits from the selector-matching process. r=dshin
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cc47d7350b4b Invalidate viewport units on container-queries properly. r=dshin

Reproduced the issue with Firefox 106.0a1 (20220913213020) and layout.css.container-queries.enabled:true using the attached test case from comment 0 on Windows 10x64.
The issue is verified fixed with Firefox 108.0b2 on Windows 10x64, macOS 11, and Ubuntu 20.04 while having the layout.css.container-queries.enabled:true. The small red div turns green after the iframe resizes.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: