Skip to content

Flexbox: Percentages should not resolve against stretched flex item with indefinite flex basis #950

Description

@nicoburns

The inner percentage in the following HTML should not resolve (should resolve against 0):

<!DOCTYPE html>
<div style="display: flex; flex-direction: column; width: 200px; min-height: 200px; background: green">
  <div style="flex-grow: 1">
    <div style="height: 100%; background: red"></div>
  </div>
</div>

A definite flex-basis set on the middle div would make the percentage resolve.

See: servo/servo#44384 (comment)


The fix for this is is probably to keep track of this within the out flexbox container's layout, and set the "parent height" to None in the case that the percentage ought not to resolve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-flexboxRelates to the Flexbox layout algorithmbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions