[csswg-drafts] [css-flexbox-1] Clarify point 9.2(4) in the flexbox algorithm (#11438)

gitspeaks has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-flexbox-1] Clarify point 9.2(4) in the flexbox algorithm ==
Is point [9.2(4)](https://www.w3.org/TR/css-flexbox-1/#algo-main-container) essentially a `goto 9.2(2)` after the main sizes of the flex items have been determined, in order to use those combined measurements as the definitive flex container main size and *restart* the algorithm assuming definite free space?

Example:

```html
<!DOCTYPE html>
<html>
<head>
<style>
  body,
  html {
    height: 100%;
    margin: 0;
  }
  .flex {
    display: flex;
    flex-flow: row nowrap;
    width: max-content;
    background: red;    
  }
  .flex > div {
    background: green;        
    flex-basis: 50%;
  }
</style>
</head>
<body>
  <div class="flex">
    <div>1234 56789</div>
  </div>
</body>
</html>
```

output:

![render](https://github.com/user-attachments/assets/a17cd60d-6fd6-45d9-ba3e-cdbf95c1f105)

Here the flex container's size is indefinite. According to the flex-basis [percentage sizing rule](https://www.w3.org/TR/css-flexbox-1/#flex-basis-property), the algorithm calculates the base size of the flex item using the same constraint set on the container — `max-content`.

The question is: once this calculation is complete, does point [9.2(4)](https://www.w3.org/TR/css-flexbox-1/#algo-main-container) instruct the algorithm to restart, using the measured main size of the child `<div>` as the flex container's definitive main size? If so, would the child `<div>`'s main size be recalculated using 50% of the flex container's now definite main size (effectively 50% of the child's previously determined `max-content` size)?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11438 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 4 January 2025 16:25:24 UTC