Skip to content

[css-contain-2] Spec is unclear about whether 0-sized boxes can be "relevant to the user" (since they have zero intersection area) #5641

@dholbert

Description

@dholbert

The "relevant to the user" ( https://www.w3.org/TR/css-contain-2/#relevant-to-the-user ) condition is defined as-follows:

An element is relevant to the user if any of the following conditions are true:

  • The element is "on-screen": its containing box's border box intersects with the viewport, or a user-agent defined margin around the viewport.
  • [...other conditions...]

This definition is ambiguous about whether or not a on-screen 0-sized box would be considered relevant or not. Such a box has 0 area, and hence it would have zero intersection, even if it's positioned on-screen. So it arguably never "intersects with the viewport" (i.e. it never has a nonzero intersection area), even when it is fully contained within the viewport.

It would be nice for the spec to make clear what happens for such boxes. Possibly just adding a sentence saying "For the purpose of this consideration, a 0-sized box is considered as intersecting this area if it is fully contained within this area."

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions