Container Query Condition Using Font-Relative Units Not Re-Evaluated When the Font Size Changes
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
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)
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.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 1•2 years ago
|
||
(Remove unnecessary web-platform-test tags that came from the source)
Assignee | ||
Comment 2•2 years ago
|
||
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...
Assignee | ||
Comment 3•2 years ago
|
||
I can take this as time allows. Thanks!
Assignee | ||
Comment 4•2 years ago
|
||
Much like we react to font-size changes on the root.
Assignee | ||
Updated•2 years ago
|
Reporter | ||
Comment 5•2 years ago
|
||
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.)
Assignee | ||
Comment 6•2 years ago
|
||
Those need a separate fix anyways, so probably worth filing in a separate bug
Reporter | ||
Updated•2 years ago
|
Comment 8•2 years ago
|
||
bugherder |
Description
•