Closed Bug 1744231 Opened 2 years ago Closed 11 months ago

Implement container relative length units


(Core :: CSS Parsing and Computation, enhancement)




108 Branch
Tracking Status
firefox108 --- fixed


(Reporter: sebo, Assigned: dshin)


(Blocks 4 open bugs, )


(Keywords: dev-doc-complete)


(5 files)

CSS Containment Module Level 3 defines different container relative length units. Those units are cqw, cqh, cqi, cqb, cqmin, cqmax.


Blocks: 1744181
Keywords: dev-doc-needed

For reference, here's a link to the relevant spec-section, in a mirror of, since is partly-down:

Depends on: 1778989
Assignee: nobody → dshin
Blocks: 1769236
  • For now, implementation always returns the fallback value, i.e. small viewport lengths.
  • Enabled via existing pref layout.css.container-queries.enabled.

For controlled construction and access of upcoming, lazily-evaluated container query size.

Depends on D158054

Low-hanging fruit optimization that enables short-circuit exit of container query lookups.

Depends on D158055

Attachment #9296029 - Attachment description: Bug 1744231: Part 5 - Recascade children when `container-type` changes. r=#layout-reviewers → Bug 1744231: Part 5 - Rematch all descendants when `container-type` changes. r=#layout-reviewers
Pushed by
Part 1 - Implement parsing of container relative lengths. r=emilio
Part 2 - Centralize construction of `computed::Context`. r=emilio
Part 3 - Flag computed styles of elements with `container-type: *size` set & propagate them to their descendants. r=emilio
Part 4 - Enable lookup and computation of container size queries. r=emilio
Part 5 - Rematch all descendants when `container-type` changes. r=emilio
Created web-platform-tests PR for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot

FF108 MDN docs work for this can be tracked in

Can you confirm that this is shipped in FF108? If not, what is the preference used to enable this?

Those units are part of the efforts around implementing container queries. So they are currently still behind the layout.css.container-queries.enabled flag.
Emilio has now added the dev-doc-needed flag to the meta-bug.

I guess, they should be mentioned together with container queries in general at, though.


Thanks Sebastian. I just found a more general issue on MDN too: Improve existing and add new documentation for container queries #20987. I'm pretty sure these will all be dealt with together as you suggest.

Blocks: 1769946
You need to log in before you can comment on or make changes to this bug.