Changeset 173156 in webkit
- Timestamp:
- Sep 1, 2014 2:33:07 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r173139 r173156 1 2014-08-29 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Resolved value of grid-template-* must include every track listed 4 https://bugs.webkit.org/show_bug.cgi?id=136362 5 6 Reviewed by Darin Adler. 7 8 Added new test cases to verify that both explicit and implicit 9 tracks are listed in grid-template-* resolved values. Also 10 refactored a testing function to improve the readability of the test. 11 12 * fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt: 13 * fast/css-grid-layout/grid-auto-columns-rows-get-set.html: 14 * fast/css-grid-layout/resources/grid-definitions-parsing-utils.js: 15 (testGridAutoDefinitionsValues): 16 1 17 2014-08-30 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 18 -
trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt
r158838 r173156 5 5 6 6 Test getting -webkit-grid-auto-columns and -webkit-grid-auto-rows set through CSS 7 PASS getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-rows') is '30px' 8 PASS getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-columns') is '50px' 9 PASS getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-rows') is 'minmax(10%, 15px)' 10 PASS getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-columns') is 'minmax(30%, 100px)' 11 PASS getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-rows') is '-webkit-min-content' 12 PASS getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-columns') is '-webkit-max-content' 7 PASS window.getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-rows') is "30px" 8 PASS window.getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-columns') is "50px" 9 PASS window.getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-rows') is "minmax(10%, 15px)" 10 PASS window.getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-columns') is "minmax(30%, 100px)" 11 PASS window.getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-rows') is "-webkit-min-content" 12 PASS window.getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-columns') is "-webkit-max-content" 13 14 Test that getting grid-template-columns and grid-template-rows set through CSS lists every track listed whether implicitly or explicitly created 15 PASS window.getComputedStyle(gridAutoFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-auto-rows') is "30px" 16 PASS window.getComputedStyle(gridAutoFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-auto-columns') is "50px" 17 PASS window.getComputedStyle(gridAutoFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-template-columns') is "50px" 18 PASS window.getComputedStyle(gridAutoFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-template-rows') is "30px" 19 PASS window.getComputedStyle(gridAutoFixedFixedWithFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-auto-rows') is "30px" 20 PASS window.getComputedStyle(gridAutoFixedFixedWithFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-auto-columns') is "40px" 21 PASS window.getComputedStyle(gridAutoFixedFixedWithFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-template-columns') is "20px 40px 40px" 22 PASS window.getComputedStyle(gridAutoFixedFixedWithFixedFixedWithChildren, '').getPropertyValue('-webkit-grid-template-rows') is "15px 30px 30px" 23 24 Test that grid-template-* definitions are not affected by grid-auto-* definitions 25 PASS window.getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-template-columns') is "none" 26 PASS window.getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-template-rows') is "none" 27 PASS window.getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-template-columns') is "none" 28 PASS window.getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-template-rows') is "none" 29 PASS window.getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-template-columns') is "none" 30 PASS window.getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-template-rows') is "none" 13 31 14 32 Test the initial value -
trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html
r168416 r173156 18 18 -webkit-grid-auto-columns: -webkit-max-content; 19 19 } 20 21 22 .gridAutoFixedFixedWithFixedFixed { 23 -webkit-grid-auto-rows: 30px; 24 -webkit-grid-auto-columns: 40px; 25 -webkit-grid-template-rows: 15px; 26 -webkit-grid-template-columns: 20px; 27 } 28 20 29 </style> 21 30 <script src="../../resources/js-test-pre.js"></script> 31 <script src="resources/grid-definitions-parsing-utils.js"></script> 22 32 </head> 23 33 <body> … … 25 35 <div class="grid gridAutoMinMax" id="gridAutoMinMax"></div> 26 36 <div class="grid gridAutoMinMaxContent" id="gridAutoMinMaxContent"></div> 37 <div class="grid gridAutoFixedFixed" id="gridAutoFixedFixedWithChildren"> 38 <div class="sizedToGridArea firstRowFirstColumn"></div> 39 </div> 40 <div class="grid gridAutoFixedFixedWithFixedFixed" id="gridAutoFixedFixedWithFixedFixedWithChildren"> 41 <div class="sizedToGridArea thirdRowAutoColumn"></div> 42 <div class="sizedToGridArea autoRowThirdColumn"></div> 43 </div> 27 44 <script> 28 45 description('Test that setting and getting grid-auto-columns and grid-auto-rows works as expected'); 29 46 30 47 debug("Test getting -webkit-grid-auto-columns and -webkit-grid-auto-rows set through CSS"); 31 var gridAutoFixedFixed = document.getElementById("gridAutoFixedFixed");32 shouldBe("getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-rows')", "'30px'");33 shouldBe("getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('-webkit-grid-auto-columns')", "'50px'");48 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixed"), "30px", "50px"); 49 testGridAutoDefinitionsValues(document.getElementById("gridAutoMinMax"), "minmax(10%, 15px)", "minmax(30%, 100px)"); 50 testGridAutoDefinitionsValues(document.getElementById("gridAutoMinMaxContent"), "-webkit-min-content", "-webkit-max-content"); 34 51 35 var gridAutoMinMax = document.getElementById("gridAutoMinMax"); 36 shouldBe("getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-rows')", "'minmax(10%, 15px)'"); 37 shouldBe("getComputedStyle(gridAutoMinMax, '').getPropertyValue('-webkit-grid-auto-columns')", "'minmax(30%, 100px)'"); 52 debug(""); 53 debug("Test that getting grid-template-columns and grid-template-rows set through CSS lists every track listed whether implicitly or explicitly created"); 54 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixedWithChildren"), "30px", "50px"); 55 testGridTemplatesValues(document.getElementById("gridAutoFixedFixedWithChildren"), "50px", "30px"); 56 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixedWithFixedFixedWithChildren"), "30px", "40px"); 57 testGridTemplatesValues(document.getElementById("gridAutoFixedFixedWithFixedFixedWithChildren"), "20px", "15px", "20px 40px 40px", "15px 30px 30px"); 38 58 39 var gridAutoMinMaxContent = document.getElementById("gridAutoMinMaxContent"); 40 shouldBe("getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-rows')", "'-webkit-min-content'"); 41 shouldBe("getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('-webkit-grid-auto-columns')", "'-webkit-max-content'"); 59 debug(""); 60 debug("Test that grid-template-* definitions are not affected by grid-auto-* definitions"); 61 testGridTemplatesValues(document.getElementById("gridAutoFixedFixed"), "none", "none"); 62 testGridTemplatesValues(document.getElementById("gridAutoMinMax"), "none", "none"); 63 testGridTemplatesValues(document.getElementById("gridAutoMinMaxContent"), "none", "none"); 42 64 43 65 debug(""); -
trunk/LayoutTests/fast/css-grid-layout/resources/grid-definitions-parsing-utils.js
r171183 r173156 60 60 document.body.removeChild(element); 61 61 } 62 63 function testGridAutoDefinitionsValues(element, computedRowValue, computedColumnValue) 64 { 65 window.element = element; 66 var elementID = element.id || "element"; 67 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('-webkit-grid-auto-rows')", computedRowValue); 68 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('-webkit-grid-auto-columns')", computedColumnValue); 69 } -
trunk/Source/WebCore/ChangeLog
r173155 r173156 1 2014-08-29 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Resolved value of grid-template-* must include every track listed 4 https://bugs.webkit.org/show_bug.cgi?id=136362 5 6 Reviewed by Darin Adler. 7 8 Section 5.1.5 of the specs clearly states that the resolved value 9 for grid-template-* must include every listed track, whether 10 explicitly or implicitly created. We were only listing the 11 explicit grid tracks. 12 13 * css/CSSComputedStyleDeclaration.cpp: 14 (WebCore::valueForGridTrackList): 15 1 16 2014-09-01 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 17 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r173047 r173156 1018 1018 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style->gridColumns() : style->gridRows(); 1019 1019 const OrderedNamedGridLinesMap& orderedNamedGridLines = direction == ForColumns ? style->orderedNamedGridColumnLines() : style->orderedNamedGridRowLines(); 1020 1021 // Handle the 'none' case here. 1022 if (!trackSizes.size()) { 1020 bool isRenderGrid = renderer && renderer->isRenderGrid(); 1021 1022 // Handle the 'none' case. 1023 bool trackListIsEmpty = trackSizes.isEmpty(); 1024 if (isRenderGrid && trackListIsEmpty) { 1025 // For grids we should consider every listed track, whether implicitly or explicitly created. If we don't have 1026 // any explicit track and there are no children then there are no implicit tracks. We cannot simply check the 1027 // number of rows/columns in our internal grid representation because it's always at least 1x1 (see r143331). 1028 trackListIsEmpty = !toRenderBlock(renderer)->firstChild(); 1029 } 1030 1031 if (trackListIsEmpty) { 1023 1032 ASSERT(orderedNamedGridLines.isEmpty()); 1024 1033 return cssValuePool().createIdentifierValue(CSSValueNone); … … 1026 1035 1027 1036 auto list = CSSValueList::createSpaceSeparated(); 1028 if ( renderer && renderer->isRenderGrid()) {1037 if (isRenderGrid) { 1029 1038 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toRenderGrid(renderer)->columnPositions() : toRenderGrid(renderer)->rowPositions(); 1030 1039 // There are at least #tracks + 1 grid lines (trackPositions). Apart from that, the grid container can generate implicit grid tracks, … … 1032 1041 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); 1033 1042 1034 for (unsigned i = 0; i < track Sizes.size(); ++i) {1043 for (unsigned i = 0; i < trackPositions.size() - 1; ++i) { 1035 1044 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, list.get()); 1036 1045 list.get().append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i], style));
Note: See TracChangeset
for help on using the changeset viewer.