Skip to content

[css2.2] Ambiguity in "participate in a block formatting context" definition #12529

Open

Description

@kannanwisen

Hello CSS Working Group,

This issue is to discuss a potential ambiguity in the definition of "Block-level boxes" in the CSS 2 specification, section 9.2.

The current text states:

Block-level boxes are boxes that participate in a block formatting context.

In this sentence, the entire phrase "block formatting context" is hyperlinked to section 9.4.1, which defines the specific rules for an element that establishes a new BFC (e.g., containing floats, stopping margin collapse).

The Point of Confusion

This structure is misleading because it implies that all block-level boxes adhere to the special rules of a BFC root. In reality, the vast majority of block-level boxes simply participate in an existing BFC inherited from an ancestor. The special rules defined in 9.4.1 do not apply to them.

This can lead a developer to incorrectly assume that any simple <div> or <p> should, for example, contain floats, which is not the case.

Proposal for Clarification

To resolve this ambiguity, I suggest refining the definition to explicitly distinguish between participating in an existing BFC and establishing a new one, and to make the hyperlink more precise.

The proposed new sentence would be:

Block-level boxes are boxes that either participate in an existing block formatting context or establish a new [block formatting context]( http://drafts.csswg.org/css2/#block-formatting).

This change is effective because:

  1. It accurately identifies the two distinct roles a block-level box can have.
  2. It correctly links only the phrase "a new block formatting context" to the section defining the special rules that apply in that specific case.

This would provide a much more accurate mental model for developers from the outset.

Thank you for your time and consideration.

Activity

  1. Loirooriol commented on Jul 27, 2025

    @Loirooriol
    Contributor

    I fail to see how you are interpreting "participates in a BFC" as "establishes a BFC". They are clearly different.

    Block-level boxes are boxes that either [...] or establish a new block formatting context.

    Your definition is wrong, e.g. an inline-block establishes a new BFC but is not block-level.

  2. kannanwisen commented on Jul 28, 2025

    @kannanwisen
    Author

    To clarify the original intent of this issue: my focus is not on the phrase "Block-level boxes are boxes," even though the original text contains this phrase.

    My focus is on the ambiguity of the phrase "participate in a block formatting context" as it is used in the current text.

    The core problem is that this general phrase is hyperlinked directly to section 9.4.1, which details the specific rules for establishing a new BFC. This structure can easily lead a reader to the incorrect conclusion that any block box that is merely "participating" will also, for example, contain floats—even a simple div element.

    My goal is to address this potential for misinterpretation caused by the hyperlink. The initial suggestion to rewrite the sentence was just one possible approach, but the fundamental issue is with the link's destination.

  3. Loirooriol commented on Jul 28, 2025

    @Loirooriol
    Contributor

    ambiguity of the phrase "participate in a block formatting context" as it is used in the current text.
    The core problem is that this general phrase is hyperlinked directly to section 9.4.1

    No. The link is not for "participate in a block formatting context", it's just for "block formatting context". So the link destination is just explaining BFCs (including how they are established).

  4. kannanwisen commented on Jul 28, 2025

    @kannanwisen
    Author

    ambiguity of the phrase "participate in a block formatting context" as it is used in the current text.
    The core problem is that this general phrase is hyperlinked directly to section 9.4.1

    No. The link is not for "participate in a block formatting context", it's just for "block formatting context". So the link destination is just explaining BFCs (including how they are established).

    The specification says:

    In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. The vertical distance between two sibling boxes is determined by the margin properties. Vertical margins between adjacent block-level boxes in a block formatting context collapse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo