Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gitspeaks opened this issue Jan 4, 2025 · 0 comments
Open

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

gitspeaks opened this issue Jan 4, 2025 · 0 comments

Comments

@gitspeaks
Copy link

Is point 9.2(4) 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:

<!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

Here the flex container's size is indefinite. According to the flex-basis percentage sizing rule, 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) 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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant