Closed Bug 1806322 Opened 2 years ago Closed 2 years ago

@container (orientation) wrongly matches elements that don't support size containment

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: Oriol, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file Testcase

https://drafts.csswg.org/css-contain-3/#size-container

If the query container does not have a principal box, or the principal box is not a layout containment box, or the query container does not support container size queries on the relevant axes, then the result of evaluating the size feature is unknown.

So @container (orientation) shouldn't match an element with display: table, display: table-cell, display: inline, or display: contents.

Blink and WebKit are correct.

https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/servo/components/style/stylesheets/container_rule.rs#335-341 should probably return a Option<bool> and https://searchfox.org/mozilla-central/rev/f40d29a11f2eb4685256b59934e637012ea6fb78/servo/components/style/queries/values.rs#26 should return None.

Allow keyword evaluators to return unknown.

Do you know of a good test to extend here? Otherwise I can add a new
one, though I gotta run atm.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/313bb8e00778 Fix container orientation evaluation. r=Oriol
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37698 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: