Closed Bug 1804066 Opened 2 years ago Closed 2 years ago

Container queries shouldn't treat an element with no box as having a size of 0

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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 (width: 0) should not match. Testcase:

<!DOCTYPE html>
<style>
div {
  container-type: inline-size;
  display: contents;
}
@container (width: 0) {
  p { background: red; }
}
</style>
<div><p>Should not be red</p></div>
Depends on: 1804126
Pushed by oriol-bugzilla@hotmail.com: https://hg.mozilla.org/integration/autoland/rev/5151bf7e6a21 @container(width:0) shouldn't match elements with no box. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37346 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 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: