Changeset 289993 in webkit
- Timestamp:
- Feb 16, 2022 7:40:20 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-001-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-002-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderGrid.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderGrid.h (modified) (1 diff)
-
Source/WebCore/rendering/style/GridPositionsResolver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r289990 r289993 1 2022-02-16 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 Manuel Rego Casasnovas. 7 8 Mark tests as no longer crashing. 9 10 * TestExpectations: 11 1 12 2022-02-16 Jon Lee <jonlee@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r289965 r289993 1435 1435 imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-mbp-overflow-003.html [ ImageOnlyFailure ] 1436 1436 imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-mbp-overflow-004.html [ ImageOnlyFailure ] 1437 imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-001.html [ Crash ]1438 imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-002.html [ Crash ]1439 1437 1440 1438 webkit.org/b/149890 fast/css-grid-layout/grid-shorthands-style-format.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r289992 r289993 1 2022-02-16 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 Manuel Rego Casasnovas. 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 1 27 2022-02-16 Fujii Hironori <Hironori.Fujii@sony.com> 2 28 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r289876 r289993 899 899 }; 900 900 901 class OrderedNamedLinesCollectorInSubgridLayout : public OrderedNamedLinesCollector { 902 public: 903 OrderedNamedLinesCollectorInSubgridLayout(const RenderStyle& style, bool isRowAxis, unsigned totalTracksCount) 904 : OrderedNamedLinesCollector(style, isRowAxis) 905 , m_insertionPoint(isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint()) 906 , m_autoRepeatLineSetListLength((isRowAxis ? style.autoRepeatOrderedNamedGridColumnLines() : style.autoRepeatOrderedNamedGridRowLines()).size()) 907 , m_totalLines(totalTracksCount + 1) 908 { 909 if (!m_autoRepeatLineSetListLength) { 910 m_autoRepeatTotalLineSets = 0; 911 return; 912 } 913 unsigned named = (isRowAxis ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines()).size(); 914 if (named >= m_totalLines) { 915 m_autoRepeatTotalLineSets = 0; 916 return; 917 } 918 m_autoRepeatTotalLineSets = (m_totalLines - named) / m_autoRepeatLineSetListLength; 919 m_autoRepeatTotalLineSets *= m_autoRepeatLineSetListLength; 920 } 921 922 void collectLineNamesForIndex(CSSGridLineNamesValue&, unsigned index) const override; 923 924 int namedGridLineCount() const override { return m_totalLines; } 925 private: 926 unsigned m_insertionPoint; 927 unsigned m_autoRepeatTotalLineSets; 928 unsigned m_autoRepeatLineSetListLength; 929 unsigned m_totalLines; 930 }; 931 901 932 void OrderedNamedLinesCollector::appendLines(CSSGridLineNamesValue& lineNamesValue, unsigned index, NamedLinesType type) const 902 933 { … … 956 987 } 957 988 989 void OrderedNamedLinesCollectorInSubgridLayout::collectLineNamesForIndex(CSSGridLineNamesValue& lineNamesValue, unsigned i) const 990 { 991 if (!m_autoRepeatLineSetListLength || i < m_insertionPoint) { 992 appendLines(lineNamesValue, i, NamedLines); 993 return; 994 } 995 996 if (i >= m_insertionPoint + m_autoRepeatTotalLineSets) { 997 appendLines(lineNamesValue, i - m_autoRepeatTotalLineSets, NamedLines); 998 return; 999 } 1000 1001 unsigned autoRepeatIndexInFirstRepetition = (i - m_insertionPoint) % m_autoRepeatLineSetListLength; 1002 appendLines(lineNamesValue, autoRepeatIndexInFirstRepetition, AutoRepeatNamedLines); 1003 } 1004 958 1005 static void addValuesForNamedGridLinesAtIndex(OrderedNamedLinesCollector& collector, unsigned i, CSSValueList& list, bool renderEmpty = false) 959 1006 { 960 if (collector.isEmpty() )1007 if (collector.isEmpty() && !renderEmpty) 961 1008 return; 962 1009 … … 1036 1083 // If the element is a grid container, the resolved value is the used value, 1037 1084 // specifying track sizes in pixels and expanding the repeat() notation. 1038 if (isRenderGrid) { 1039 // FIXME: We need to handle computed subgrid here. 1085 // If subgrid was specified, but the element isn't a subgrid (due to not having 1086 // an appropriate grid parent), then we fall back to using the specified value. 1087 if (isRenderGrid && (!isSubgrid || downcast<RenderGrid>(renderer)->isSubgrid(direction))) { 1040 1088 auto* grid = downcast<RenderGrid>(renderer); 1089 if (isSubgrid) { 1090 OrderedNamedLinesCollectorInSubgridLayout collector(style, isRowAxis, grid->numTracks(direction)); 1091 populateSubgridLineNameList(list.get(), collector); 1092 return list; 1093 } 1041 1094 OrderedNamedLinesCollectorInGridLayout collector(style, isRowAxis, grid->autoRepeatCountForDirection(direction), autoRepeatTrackSizes.size()); 1042 1095 // Named grid line indices are relative to the explicit grid, but we are including all tracks. -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r289986 r289993 496 496 ASSERT(!availableSize || availableSize.value() != -1); 497 497 bool isRowAxis = direction == ForColumns; 498 if (isSubgrid(direction)) 499 return 0; 500 498 501 const auto& autoRepeatTracks = isRowAxis ? style().gridAutoRepeatColumns() : style().gridAutoRepeatRows(); 499 502 unsigned autoRepeatTrackListLength = autoRepeatTracks.size(); -
trunk/Source/WebCore/rendering/RenderGrid.h
r289986 r289993 102 102 } 103 103 104 unsigned numTracks(GridTrackSizingDirection direction) const 105 { 106 return numTracks(direction, m_grid); 107 } 108 104 109 private: 105 110 ItemPosition selfAlignmentNormalBehavior(const RenderBox* child = nullptr) const override -
trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp
r289986 r289993 80 80 81 81 m_autoRepeatTrackListLength = isRowAxis ? gridContainerStyle.gridAutoRepeatColumns().size() : gridContainerStyle.gridAutoRepeatRows().size(); 82 // FIXME: Handle subgrid auto repeat tracks 83 if (isRowAxis ? gridContainerStyle.gridSubgridColumns() : gridContainerStyle.gridSubgridRows()) { 84 m_autoRepeatTrackListLength = 0; 85 m_autoRepeatNamedLinesIndexes = nullptr; 86 } 82 87 } 83 88
Note: See TracChangeset
for help on using the changeset viewer.