Skip to content

[css2] Percentages used to compute to auto; now compute to a percentage but are used as auto #1051

@FremyCompany

Description

@FremyCompany

It seems the group accepted an errata in 2013 regarding the computed value of the "height" property. I think that was a mistake and would like to revert that errata. It was applied in those two commits.

This change requires to complexify all other specs in order to deal with the case of "broken percentages" everywhere we want to deal with the "auto" case. Since most specs didn't this is bound to continue to cause issues when developers reimplement specs or part of specs, like what happened in this Chrome issue.

Other specs continue to assume the old behavior, like css-sizing (in multiple places). Furthermore, it specifies this behavior for other values like fill-content etc when they can't resolve, like we do for percentages.

Note that percentages resolved against the intrinsic sizes (max-content, min-content, fit-content) will compute to auto, as defined by CSS 2.1.

[...] if the computed inline-size of the block is fit-content, auto, or stretch, its min-content inline-size contribution is its min-content inline size plus any inline-axis margin, border, and padding.

It is appropriate to resolve percentage heights on direct children of table cells if the cell is considered to have its height specified explicitly or the element is absolutely positioned, see CSS 2. It is further clarified that a cell is considered to have its height specified explicitly if the computed height of the cell [...] is a length or percentage.

cc @tabatkins @fantasai @dbaron @SimonSapin @bert-github

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions