Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate FlexLine functionality (#39396)
Summary: X-link: facebook/yoga#1374 Pull Request resolved: #39396 Yoga today has a struct `CollectFlexItemsRowValues`, and function `calculateFlexItemsRowValues()`. These names have evolved over time into something not making much sense. The job of `calculateFlexItemsRowValues()` is a flex-wrap container into lines (i.e. line-breaking main-axis content, which may be row or column). It returns line-breaking results, but some other fields on `calculateFlexItemsRowValues()` are set much later in the process, and the struct is acting effectivelty as a holder for the line-specific values. This change: 1. Does some renaming (mainly to FlexLine) 2. Reconciles the count `itemsOnLine` and list `relativeChildren` to list `itemsInFlow` (`relativeChildren` is a lie, as it can include elements with `YGPositionTypeStatic` and exclude relative elements which have `display: "none"`. It really just means children which are included in the layout flow for the line) 3. Makes non-changing algorithm outputs const for clarity of what is a running value, and what is a result of line-breaking values with flex basis. 4. Moves working layout values to a substructure `flexLine.layout` 5. Replaces some dishonest documentation about `endOfLineIndex`. 6. Extracts this logic out of `CalculateLayout()` to a separate file 7. Extracts `boundAxis` wholesale into a separate file, to be usable outside of `CalculateLayout.cpp` Reviewed By: rshest Differential Revision: D49133837 fbshipit-source-id: ec68c5a3d2f01e7c9bd8d26e28298331a3fe2475
- Loading branch information