CSS Grid algorithm 2/N: auto-placement (#57532)#57532
Open
rozele wants to merge 2 commits into
Open
Conversation
Differential Revision: D110780559
|
@rozele has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111722622. |
rozele
pushed a commit
to rozele/react-native-macos
that referenced
this pull request
Jul 13, 2026
Summary: Pull Request resolved: react#57532 Implements the CSS Grid auto placement algorithm ([§8.5](https://www.w3.org/TR/css-grid-1/#auto-placement-algo)). ## How? - **AutoPlacement** — the four-step placement algorithm. - **LinePlacement** — grid-line resolution ([§8.3](https://www.w3.org/TR/css-grid-1/#grid-placement-errors)), including invalid-input handling: `line 0` is treated as `auto`, and `span 0` / negative spans clamp to `1`. - **OccupancyGrid** — overlap tracking for placed items. - Unit tests (line resolution), algorithm tests, and regression tests for the invalid-input cases. ## Not yet implemented These will be introduced later. Default `grid-auto-flow` is `row` so it won't be an issue. - **Dense packing** (`grid-auto-flow: dense`) - **Column flow** (`grid-auto-flow: column`) ## Notes - Stacked on react/yoga#1923 (data structures); until that lands this diff also shows its `GridItem.h` / `GridTrack.h` — those belong to react/yoga#1923. cc - rozele This a small chunk from react/yoga#1894 PR. X-link: react/yoga#1994 Differential Revision: D111722622 Pulled By: rozele
30a5aca to
aa61ab1
Compare
aa61ab1 to
44c0d10
Compare
rozele
pushed a commit
to rozele/react-native-macos
that referenced
this pull request
Jul 13, 2026
Summary: Pull Request resolved: react#57532 Implements the CSS Grid auto placement algorithm ([§8.5](https://www.w3.org/TR/css-grid-1/#auto-placement-algo)). ## How? - **AutoPlacement** — the four-step placement algorithm. - **LinePlacement** — grid-line resolution ([§8.3](https://www.w3.org/TR/css-grid-1/#grid-placement-errors)), including invalid-input handling: `line 0` is treated as `auto`, and `span 0` / negative spans clamp to `1`. - **OccupancyGrid** — overlap tracking for placed items. - Unit tests (line resolution), algorithm tests, and regression tests for the invalid-input cases. ## Not yet implemented These will be introduced later. Default `grid-auto-flow` is `row` so it won't be an issue. - **Dense packing** (`grid-auto-flow: dense`) - **Column flow** (`grid-auto-flow: column`) ## Notes - Stacked on react/yoga#1923 (data structures); until that lands this diff also shows its `GridItem.h` / `GridTrack.h` — those belong to react/yoga#1923. cc - rozele This a small chunk from react/yoga#1894 PR. X-link: react/yoga#1994 Differential Revision: D111722622 Pulled By: rozele
Summary: Pull Request resolved: react#57532 Implements the CSS Grid auto placement algorithm ([§8.5](https://www.w3.org/TR/css-grid-1/#auto-placement-algo)). ## How? - **AutoPlacement** — the four-step placement algorithm. - **LinePlacement** — grid-line resolution ([§8.3](https://www.w3.org/TR/css-grid-1/#grid-placement-errors)), including invalid-input handling: `line 0` is treated as `auto`, and `span 0` / negative spans clamp to `1`. - **OccupancyGrid** — overlap tracking for placed items. - Unit tests (line resolution), algorithm tests, and regression tests for the invalid-input cases. ## Not yet implemented These will be introduced later. Default `grid-auto-flow` is `row` so it won't be an issue. - **Dense packing** (`grid-auto-flow: dense`) - **Column flow** (`grid-auto-flow: column`) ## Notes - Stacked on react/yoga#1923 (data structures); until that lands this diff also shows its `GridItem.h` / `GridTrack.h` — those belong to react/yoga#1923. cc - rozele This a small chunk from react/yoga#1894 PR. X-link: react/yoga#1994 Differential Revision: D111722622 Pulled By: rozele
44c0d10 to
9c09210
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Implements the CSS Grid auto placement algorithm (§8.5).
How?
line 0is treated asauto, andspan 0/ negative spans clamp to1.Not yet implemented
These will be introduced later. Default
grid-auto-flowisrowso it won't be an issue.grid-auto-flow: dense)grid-auto-flow: column)Notes
GridItem.h/GridTrack.h— those belong to CSS Grid algorithm 1/N: data structures yoga#1923.cc - rozele This a small chunk from react/yoga#1894 PR.
X-link: react/yoga#1994
Differential Revision: D111722622
Pulled By: rozele