Closed Bug 1790495 Opened 2 years ago Closed 2 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: dshin, Assigned: emilio)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Attached file Mimimum Reproducible Case (obsolete) —

STR: Load attached test case with layout.css.container-queries.enabled set to true
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.

Prior to the load callback, the query in question (height = 10em) evaluates to false as font-size: 2px and 10em == 20px. After the callback, font-size is set to 1px and so 10em == 10px, which matches #container's height.

Seems that we should re-evaluate the condition when the value the relative length unit depends on changes.

(Remove unnecessary web-platform-test tags that came from the source)

Attachment #9294330 - Attachment is obsolete: true

Hmm, this is a bit tricky, but should be reasonably workable. Basically, we need to add a new ChildCascadeRequirement (and probably rename that type since now we'd not only cascade but also re-selector-match). If we're a container and our font-size changes we need to return this stronger hint. Ideally only if any query has matched already against relative units...

I can take this as time allows. Thanks!

Assignee: nobody → emilio
Flags: needinfo?(emilio)

Much like we react to font-size changes on the root.

Flags: needinfo?(emilio)

Ahh - my bad. I was focused on distilling down the test case so I ended up using em units, but the same problem exists for viewport units (Found while working on container query units.)

Those need a separate fix anyways, so probably worth filing in a separate bug

Summary: Container Query Condition Not Re-Evaluated When They Should → Container Query Condition Using Font-Relative Units Not Re-Evaluated When the Font Size Changes
See Also: → 1790652
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dff049971660 React to font-size changes on query containers. r=dshin
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Regressions: 1807717
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: