Closed Bug 1744231 Opened 2 years ago Closed 11 months ago

Implement container relative length units

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: sebo, Assigned: dshin)

References

(Blocks 4 open bugs, )

Details

(Keywords: dev-doc-complete)

Attachments

(5 files)

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

Sebastian

Blocks: 1744181
Keywords: dev-doc-needed

For reference, here's a link to the relevant spec-section, in a mirror of drafts.csswg.org, since drafts.csswg.org is partly-down:
https://andreubotella.com/csswg-auto-build/css-contain-3/#container-lengths

Depends on: 1778989
Assignee: nobody → dshin
Status: NEW → ASSIGNED
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 dshin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/840bdd4142f4
Part 1 - Implement parsing of container relative lengths. r=emilio
https://hg.mozilla.org/integration/autoland/rev/0792a4e5363e
Part 2 - Centralize construction of `computed::Context`. r=emilio
https://hg.mozilla.org/integration/autoland/rev/361c82fbc7a8
Part 3 - Flag computed styles of elements with `container-type: *size` set & propagate them to their descendants. r=emilio
https://hg.mozilla.org/integration/autoland/rev/7e4e5ed528ef
Part 4 - Enable lookup and computation of container size queries. r=emilio
https://hg.mozilla.org/integration/autoland/rev/c2f047ea3f07
Part 5 - Rematch all descendants when `container-type` changes. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36502 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot

FF108 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/22119

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 https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Experimental_features, though.

Sebastian

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.