Re: [csswg-drafts] [css-contain] Similar to window.matchMedia(), Container Queries should have a similar method (#6205)

Yeah, `iframe.matchMedia()` checks the parent document, not the nested one. So here it's the same.

Also, consider `@container (width > 30em), (height > 40em)`: `width` and `height` can even query different containers. So it's not clear what this means if the context element was supposed to be "the" container, especially if if only contains in one or zero axes.

For observing the element itself, better use `ResizeObserver` instead, and if needed for style queries or such, consider new observers in different issues (e.g. `ComputedStyleObserver` in #8982)

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6205#issuecomment-4022250342 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 9 March 2026 09:10:12 UTC