Auto cross axis margins are ignored in wrapping containers and baseline rows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in CalculateLayout.cpp at STEP 8, which the report identifies as overwriting cross-axis positions set by STEP 7 when items have auto margins. Read the related Flexbox steps cited in the issue and compare the reported wrap and baseline cases. Add the described cases as gentest fixtures and verify their cross positions and sizes match the expected values.
索引モデルが issue の本文から書いたものです。
説明
Report
- I have searched existing issues and this is not a duplicate
Issues and Steps to Reproduce
With flexWrap: 'wrap' or 'wrap-reverse', or in a row where any item uses baseline alignment, cross axis auto margins are ignored.
Take a row 200 wide with children 50x50 and 50x10, the second with marginTop: 'auto', and read the second child's top under each alignItems. For the baseline column there is no wrap and the first child has alignSelf: 'baseline'.
Expected Behavior
Top 40 in every case, as without wrap. Following CSS Flexbox 1 (9.4 steps 8 and 11, 9.6 steps 13 and 14), auto margins take the line's free space, and such an item is not stretched, baseline aligned or aligned by align-self.
Actual Behavior
alignItems |
no wrap | wrap | baseline | expected |
|---|---|---|---|---|
flex-start |
40 | 0 | 0 | 40 |
center |
40 | 20 | 20 | 40 |
flex-end |
40 | 40 | 40 | 40 |
stretch |
40 | 0 | 0 | 40 |
With wrap, marginBottom: 'auto' or both margins auto give the same column (expected 0 and 20), and under stretch a second child with no height gets top 0 and height 50 (expected top 50, height 0). alignItems: 'baseline' with marginBottom: 'auto' gives 40 (expected 0). YGErrataAll and YGErrataNone agree.
The cause is STEP 8 in CalculateLayout.cpp, which runs in both cases. It sets each item's cross position from its alignment with auto margins as 0, overwriting STEP 7's offset. Found in #2045.
Link to Code
The trees above use only the public C API, and I can add them as gentest fixtures with a fix.
- 主要言語
- C++
- スター
- 18.9k
- フォーク
- 1.6k
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/yoga のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Measured nodes in a cached subtree grow by a rounding step on every layout pass対応中かも @salmanmkc が 6 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Stale computedFlexBasis is reused across layouts: a flex: 1 node keeps its previous size after relayout at a new root size対応中かも @mozzius が 64 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
eic/TimeframeBuilder#102 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AcademySoftwareFoundation/OpenImageIO#5662 ·
メンテナーはふだん 2 日以内に返信
-
python
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
OpenChemistry/avogadrolibs#3295 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Tracktion/tracktion_engine#482 ·
メンテナーはふだん 1 日以内に返信