Skip to content

[css-flex] Nobody follows the spec regarding intrinsic size of flex container #10779

@Loirooriol

Description

@Loirooriol
<!DOCTYPE html>
<style>
.flexbox {
  display: flex;
  flex-direction: column;
  border: solid;
}
.flexbox > div {
  flex: 1 1 100px;
  line-height: 200px;
  min-width: 0;
  min-height: 0;
}
</style>
<div class="flexbox">
  <div>Flex item</div>
</div>

According to https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes

if a flex container has a single flex item with flex-basis: 100px; but a max-content size of 200px, then when the item is flex-grow: 0, the flex container (and flex item) is 100px wide, but when the item is flex-grow: 1 or higher, the flex container (and flex item) is 200px wide.

So here the flex container should be 200px tall, but all Gecko/Blink/WebKit produce 100px instead.

In Servo we are now following the spec so we modified this WPT: web-platform-tests/wpt@6185316

But I wonder if the spec should change if the main implementations aren't planning to align with it.

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