Skip to content

fix(css): remove container-type from containing block list#43959

Merged
chrisdavidmills merged 2 commits intomdn:mainfrom
nielskaspers:docs/issue-43405-container-type-containing-block
Apr 30, 2026
Merged

fix(css): remove container-type from containing block list#43959
chrisdavidmills merged 2 commits intomdn:mainfrom
nielskaspers:docs/issue-43405-container-type-containing-block

Conversation

@nielskaspers
Copy link
Copy Markdown
Contributor

Summary

Removes the container-type bullet from the list of declarations that cause an element to form a containing block for absolutely/fixed positioned descendants. The CSSWG resolved that container-type no 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 the container-type bullet under item 4 of "Identifying the containing block".

References

@nielskaspers nielskaspers requested a review from a team as a code owner April 29, 2026 06:05
@nielskaspers nielskaspers requested review from chrisdavidmills and removed request for a team April 29, 2026 06:05
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

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.
@nielskaspers
Copy link
Copy Markdown
Contributor Author

Good catch — you're reading the resolution right. From w3c/csswg-drafts#10544:

RESOLVED: container-type does not force layout containment, but does force an independent formatting context

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:

  • Web/CSS/Guides/Display/Formatting_contexts — added under the BFC-creation list.
  • Web/CSS/Guides/Display/Block_formatting_context — added near the contain bullet.

I phrased it as "Query containers (elements where container-type isn't normal)" so it covers size, inline-size, scroll-state, and anchored without enumerating each. Happy to reword if you'd prefer the spec's "independent formatting context" terminology spelled out, or split into a separate sentence after the BFC list.

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this works great, thanks again, @nielskaspers! Let's get it in.

@chrisdavidmills chrisdavidmills merged commit 1949769 into mdn:main Apr 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed

3 participants