fix(css): remove container-type from containing block list#43959
Conversation
|
Preview URLs (3 pages)
(comment last updated: 2026-04-29 20:22:03) |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Hi, @nielskaspers! Thanks for fixing this.
What you have done here makes total sense, but I also wonder whether you should update the following articles to say that container-type forms an independent formatting context:
- https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Formatting_contexts
- https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Block_formatting_context
I think this is the case, if I'm reading the CSSWG resolution thread correctly?
Per CSSWG resolution (w3c/csswg-drafts#10544), container-type with any non-normal value forces an independent formatting context. Add it to the BFC creation lists in both the Formatting Contexts intro and the Block Formatting Context guide so the rule is discoverable from the places readers actually look.
|
Good catch — you're reading the resolution right. From w3c/csswg-drafts#10544:
That's also reflected in css-conditional-5 ("…establishes an independent formatting context") for the values that establish a query container. Pushed a small follow-up that adds a bullet to both lists:
I phrased it as "Query containers (elements where |
chrisdavidmills
left a comment
There was a problem hiding this comment.
I think this works great, thanks again, @nielskaspers! Let's get it in.
Summary
Removes the
container-typebullet from the list of declarations that cause an element to form a containing block for absolutely/fixed positioned descendants. The CSSWG resolved thatcontainer-typeno longer forces layout containment — it only establishes an independent formatting context — and this change has shipped in Chrome, Firefox, and Safari.Issue
Fixes #43405
Changes
files/en-us/web/css/guides/display/containing_block/index.md: drop thecontainer-typebullet under item 4 of "Identifying the containing block".References