Commit b0174fe
committed
Bug 1966450 - Skip measuring reflow for grid items when grid container is computing its intrinsic inline contribution. r=dholbert
In Bug 1944423, we introduced logic to resolve row sizes when computing a grid
container's intrinsic inline-size. This can cause grid items to be reflowed to
measure their block-sizes as their content contributions. Since the grid
container is still computing its intrinsic inline-size at this point, the reflow
occurs under provisional inline constraints. As a result, the grid items' sizes
are temporary and must be reflowed again later under the container's final
inline-size.
In `grid-container-as-flex-item-001.html`, when the outer grid container
prepares a `ReflowInput` for the final reflow of its grid item (the flex
container), it calls `GetMinISize()` [1], which recursively calls into the inner
grid container's `GetMinISize()`, triggering the row size resolution and reflows
the inner grid items as described above.
However, if the inner grid container has already been reflowed during a previous
content measurement by the flex container, its block-size might be cached. In
this case, the flex container may skip reflowing the inner grid container,
leading to incorrect layout results.
This patch fixes the issue by skipping the measuring reflow for grid item
entirely when the grid container is computing its intrinsic inline contribution.
This avoid triggering an unnecessary grid item reflow that under provisional
inline constraints.
[1] `GetMinSize()` is called in `nsIFrame::ComputeSize()`:
https://searchfox.org/mozilla-central/rev/fdb34ddfe30bd54aba991feb72b1476c77938e46/layout/generic/nsIFrame.cpp#6771-6773
Differential Revision: https://phabricator.services.mozilla.com/D2541311 parent a57936c commit b0174fe
File tree
7 files changed
+187
-59
lines changed- layout/generic
- testing/web-platform
- meta/css/css-grid
- tests/css/css-grid
7 files changed
+187
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5958 | 5958 | | |
5959 | 5959 | | |
5960 | 5960 | | |
5961 | | - | |
5962 | | - | |
5963 | | - | |
5964 | | - | |
5965 | | - | |
5966 | | - | |
5967 | | - | |
5968 | | - | |
5969 | | - | |
5970 | | - | |
5971 | | - | |
5972 | | - | |
5973 | | - | |
5974 | | - | |
5975 | | - | |
5976 | | - | |
5977 | | - | |
5978 | | - | |
5979 | | - | |
5980 | | - | |
5981 | | - | |
5982 | | - | |
5983 | | - | |
5984 | | - | |
5985 | | - | |
5986 | | - | |
5987 | | - | |
5988 | | - | |
5989 | | - | |
5990 | | - | |
5991 | | - | |
5992 | | - | |
5993 | | - | |
| 5961 | + | |
| 5962 | + | |
| 5963 | + | |
| 5964 | + | |
| 5965 | + | |
| 5966 | + | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
| 5970 | + | |
| 5971 | + | |
| 5972 | + | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
| 5980 | + | |
| 5981 | + | |
| 5982 | + | |
| 5983 | + | |
| 5984 | + | |
| 5985 | + | |
| 5986 | + | |
| 5987 | + | |
| 5988 | + | |
| 5989 | + | |
| 5990 | + | |
| 5991 | + | |
| 5992 | + | |
| 5993 | + | |
| 5994 | + | |
| 5995 | + | |
| 5996 | + | |
| 5997 | + | |
| 5998 | + | |
| 5999 | + | |
| 6000 | + | |
| 6001 | + | |
| 6002 | + | |
| 6003 | + | |
| 6004 | + | |
| 6005 | + | |
| 6006 | + | |
| 6007 | + | |
| 6008 | + | |
| 6009 | + | |
| 6010 | + | |
| 6011 | + | |
| 6012 | + | |
| 6013 | + | |
| 6014 | + | |
| 6015 | + | |
| 6016 | + | |
| 6017 | + | |
| 6018 | + | |
| 6019 | + | |
| 6020 | + | |
| 6021 | + | |
| 6022 | + | |
| 6023 | + | |
| 6024 | + | |
5994 | 6025 | | |
5995 | 6026 | | |
5996 | | - | |
5997 | | - | |
5998 | | - | |
5999 | | - | |
6000 | | - | |
| 6027 | + | |
| 6028 | + | |
| 6029 | + | |
6001 | 6030 | | |
6002 | 6031 | | |
6003 | 6032 | | |
| |||
6011 | 6040 | | |
6012 | 6041 | | |
6013 | 6042 | | |
6014 | | - | |
6015 | | - | |
6016 | | - | |
6017 | | - | |
6018 | | - | |
6019 | | - | |
6020 | | - | |
6021 | | - | |
| 6043 | + | |
| 6044 | + | |
6022 | 6045 | | |
6023 | | - | |
6024 | | - | |
6025 | | - | |
6026 | | - | |
6027 | | - | |
| 6046 | + | |
6028 | 6047 | | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
6029 | 6051 | | |
6030 | | - | |
6031 | | - | |
6032 | | - | |
6033 | | - | |
6034 | | - | |
6035 | | - | |
6036 | | - | |
6037 | | - | |
6038 | 6052 | | |
6039 | 6053 | | |
6040 | 6054 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments