Skip to content

[css-sizing] stretch-fit sizing doesn't cover grid items, or "theoretical layout" #1613

@tabatkins

Description

@tabatkins

When looking for how big stretch should become (Stretch-Fit Sizing), there are two cases that it looks at:

  • the element is root/abspos, in which case it returns the size of the containing block
  • otherwise, it does some min/max based on the min/max/ordinary inline-size properties of the element establishing the containing block (or recurses, if inline-size isn't definite)

These two cases miss some elements. A grid item would fall into the second bullet, but its containing block (the grid area) is established by the grid container, and you do not want the grid container's width to be consulted here! Instead, you just want to use the size of the grid area, like the first bullet point.

Similarly, any time we do "hypothetical" layout of an element in the course of running a layout algorithm (like, "layout the element into X space"), we want to use that explicitly-given size; there's no element establishing a containing block at all!

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