12022-02-15 Matt Woodrow <mattwoodrow@apple.com>
2
3 Implement getComputedStyle for subgrids
4 https://bugs.webkit.org/show_bug.cgi?id=236148
5
6 Reviewed by NOBODY (OOPS!).
7
8 Adds OrderedNamedLinesCollectorInSubgridLayout to iterate the subgrid names list, stopping
9 at the number of actual tracks in the grid.
10
11
12 * css/CSSComputedStyleDeclaration.cpp:
13 (WebCore::OrderedNamedLinesCollectorInSubgridLayout::OrderedNamedLinesCollectorInSubgridLayout):
14 (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
15 (WebCore::OrderedNamedLinesCollectorInSubgridLayout::collectLineNamesForIndex const):
16 (WebCore::addValuesForNamedGridLinesAtIndex):
17 (WebCore::populateSubgridTrackList):
18 (WebCore::valueForGridTrackList):
19 * rendering/RenderGrid.cpp:
20 (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
21 * rendering/RenderGrid.h:
22 * rendering/style/GridPositionsResolver.cpp:
23 (WebCore::NamedLineCollection::contains const):
24 * style/StyleBuilderConverter.h:
25 (WebCore::Style::BuilderConverter::createGridTrackList):
26
27
28 Inherit track count from parent grid for subgridded axes and clamp item placement to that explicit grid.
29 https://bugs.webkit.org/show_bug.cgi?id=236122
30
31 Reviewed by NOBODY (OOPS!).
32
33 Changes GridPositionsResolver::explicitGrid<>Count to return the number of tracks
34 spanned in the parent grid, for axes that are a subgrid.
35
36 Updates adjustGridPositionsForStyle to use the number of lines specified in the
37 subgrid property, for grid items that are also a subgrid and have an otherwise
38 indefinite span.
39
40 Adds clamping support to Grid so that we can prevent subgrids from ever adding
41 new implicit tracks.
42
43 * rendering/Grid.cpp:
44 (WebCore::Grid::insert):
45 (WebCore::Grid::setClampingForSubgrid):
46 (WebCore::Grid::clampAndTranslateToImplicitGrid):
47 (WebCore::Grid::setNeedsItemsPlacement):
48 * rendering/Grid.h:
49 * rendering/RenderGrid.cpp:
50 (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
51 (WebCore::RenderGrid::placeItemsOnGrid const):
52 (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
53 (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
54 (WebCore::RenderGrid::isSubgrid const):
55 (WebCore::RenderGrid::isSubgridRows const):
56 (WebCore::RenderGrid::isSubgridColumns const):
57 (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
58 (WebCore::RenderGrid::numTracks const):
59 (WebCore::transposedDirection):
60 (WebCore::RenderGrid::computeGridSpanForOutOfFlowChild const):
61 (WebCore::RenderGrid::gridSpanForOutOfFlowChild const):
62 (WebCore::RenderGrid::gridSpanForChild const):
63 * rendering/RenderGrid.h:
64 * rendering/style/GridArea.h:
65 (WebCore::GridSpan::integerSpan const):
66 (WebCore::GridSpan::translateTo):
67 (WebCore::GridSpan::clamp):
68 * rendering/style/GridPositionsResolver.cpp:
69 (WebCore::isIndefiniteSpan):
70 (WebCore::adjustGridPositionsFromStyle):
71 (WebCore::GridPositionsResolver::explicitGridColumnCount):
72 (WebCore::GridPositionsResolver::explicitGridRowCount):
73 (WebCore::explicitGridSizeForSide):
74 (WebCore::resolveNamedGridLinePositionFromStyle):
75 (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
76 (WebCore::resolveGridPositionAgainstOppositePosition):
77 (WebCore::resolveGridPositionFromStyle):
78 (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
79 * rendering/style/GridPositionsResolver.h:
80