Skip to content

[css-sizing] Clarify how contain-intrinsic-size affects size containment algorithm #7519

@Loirooriol

Description

@Loirooriol

CSS Containment has a full algorithm for sizing elements with sizing containment: https://drafts.csswg.org/css-contain-2/#containment-size.

But https://drafts.csswg.org/css-sizing-4/#explicit-intrinsic-inner-size just handwaves

If an element has an explicit intrinsic inner size in an axis, then after laying out the element as normal for size containment, the size of the contents in that axis are instead treated as being the explicit intrinsic inner size instead of what was calculated in layout, and layout is performed again if necessary. (If it has an explicit intrinsic inner size in both axises, this implies the first layout can be skipped.)

It's not clear:

  • When it says "after laying out the element as normal", does this cover all steps of https://drafts.csswg.org/css-contain-2/#containment-size or only some of them?
  • When it says "the contents in that axis are instead treated as being the explicit intrinsic inner size", why didn't we do this from the beginning? Why do a former layout as if there was no content?
  • When it says "and layout is performed again if necessary", when it's not necessary?
  • When it says "If it has an explicit intrinsic inner size in both axises, this implies the first layout can be skipped", why isn't it always the case?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Tuesday

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions