Commit 3bdeec8
committed
Set containing block of grid-lanes items to container size in the stacking axis
https://bugs.webkit.org/show_bug.cgi?id=304715
rdar://167221488
Reviewed by Brandon Stewart.
Because grid items have a grid area in both axes, there are many places in the
grid code where we set its containing block to a grid area in both axes.
However the containing block of a grid-lanes item in the stacking axis is its
grid container, not a grid area. Trying to use a grid area results in
nonsensical item sizes in cases where the item size depends on the container
(e.g. fit-content, percentages).
This patch factors out the places where we try to set the item's containing
block and ensures we set it correctly in the stacking axis for grid-lanes items.
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/abspos/column-grid-lanes-positioned-item-dynamic-change.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/track-sizing/grid-lanes-track-sizing-check-grid-height-on-resize.html:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/rendering/GridMasonryLayout.cpp:
(WebCore::GridMasonryLayout::setItemContainingBlockToGridArea):
(WebCore::GridMasonryLayout::insertIntoGridAndLayoutItem):
(WebCore::GridMasonryLayout::setItemGridAxisContainingBlockToGridArea): Deleted.
* Source/WebCore/rendering/GridMasonryLayout.h:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::selfAlignmentForGridItem const):
(WebCore::RenderGrid::performPreLayoutForGridItems const):
(WebCore::RenderGrid::updateGridAreaWithEstimate const):
(WebCore::RenderGrid::updateGridAreaIncludingAlignment const):
(WebCore::RenderGrid::updateGridAreaForAspectRatioItems):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutMasonryItems):
(WebCore::RenderGrid::gridAreaBreadthForGridItemIncludingAlignmentOffsets const):
* Source/WebCore/rendering/RenderGrid.h:
Canonical link: https://commits.webkit.org/305319@main1 parent cb75605 commit 3bdeec8
File tree
7 files changed
+49
-24
lines changed- LayoutTests
- imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative
- abspos
- track-sizing
- Source/WebCore/rendering
7 files changed
+49
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
1712 | | - | |
1713 | 1712 | | |
1714 | 1713 | | |
1715 | 1714 | | |
| |||
1725 | 1724 | | |
1726 | 1725 | | |
1727 | 1726 | | |
1728 | | - | |
1729 | 1727 | | |
1730 | 1728 | | |
1731 | 1729 | | |
| |||
1770 | 1768 | | |
1771 | 1769 | | |
1772 | 1770 | | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | 1771 | | |
1777 | 1772 | | |
1778 | 1773 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
116 | 125 | | |
117 | | - | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
120 | 132 | | |
121 | 133 | | |
122 | 134 | | |
| |||
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
148 | | - | |
| 160 | + | |
149 | 161 | | |
150 | 162 | | |
151 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
1256 | | - | |
| 1256 | + | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| |||
1265 | 1265 | | |
1266 | 1266 | | |
1267 | 1267 | | |
1268 | | - | |
| 1268 | + | |
1269 | 1269 | | |
1270 | 1270 | | |
1271 | 1271 | | |
| |||
1543 | 1543 | | |
1544 | 1544 | | |
1545 | 1545 | | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1546 | 1568 | | |
1547 | 1569 | | |
1548 | 1570 | | |
| |||
1562 | 1584 | | |
1563 | 1585 | | |
1564 | 1586 | | |
1565 | | - | |
| 1587 | + | |
1566 | 1588 | | |
1567 | 1589 | | |
1568 | 1590 | | |
| |||
1588 | 1610 | | |
1589 | 1611 | | |
1590 | 1612 | | |
1591 | | - | |
| 1613 | + | |
1592 | 1614 | | |
1593 | 1615 | | |
1594 | 1616 | | |
| |||
1632 | 1654 | | |
1633 | 1655 | | |
1634 | 1656 | | |
1635 | | - | |
| 1657 | + | |
1636 | 1658 | | |
1637 | 1659 | | |
1638 | 1660 | | |
| |||
1695 | 1717 | | |
1696 | 1718 | | |
1697 | 1719 | | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | 1720 | | |
1705 | 1721 | | |
1706 | 1722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
0 commit comments