这是indexloc提供的服务,不要输入任何密码
Skip to content

Intrinsic sizing keywords (min/max/fit-content) for width/height #751

@nicoburns

Description

@nicoburns

What problem does this solve or what need does it fill?

These keywords allow users to opt-in to sizing behaviour that Taffy already supports but can currently only be accessed implicitly or via grid-template sizing functions.

What solution would you like?

  • Add MinContent, MaxContent, and FitContent variants to Dimension.
  • Implement the sizing logic in the Flexbox, Grid, and Block layout algorithms by overriding the AvailableSpace provided to child nodes if their width/height is one of these keywords.
  • We will need to be careful that this will remove the invariant that available_space == parent_size

Additional context

A bunch of Flexbox WPT tests rely on these keywords, so if we want accurate test results then we need to implement them!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions