Container Size Queries

Acceptable Support Updated: Jan 23, 2026

Enable querying the size of a defined container and responding to that size by applying rulesets to its children.

Baseline:
Widely
Functional:
Critical
Usage:
Cross-Boundary

Essential access to query light DOM-defined containers from within the shadow DOM is supported.

Additionally, most other queries for :host, ::slotted(), and ::part() defined containers will work as expected.

Web Platform Test
Chrome 147
Edge 146
Firefox 149
Safari 26.4
Outer scope query should match container-name set by ::slotted rule in shadow tree
pass
pass
pass
fail
WPT sources: container-for-shadow-dom, container-name-tree-scoped