OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1); | 5 testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1); |
6 </script> | 6 </script> |
7 <link href="resources/grid.css" rel="stylesheet"> | 7 <link href="resources/grid.css" rel="stylesheet"> |
8 <script src="../../resources/check-layout.js"></script> | 8 <script src="../../resources/check-layout.js"></script> |
9 <style> | 9 <style> |
10 .grid { | 10 .grid { |
11 grid-auto-flow: row; | 11 grid-auto-flow: row; |
12 } | 12 } |
13 #firstGridItem { | 13 #firstGridItem { |
14 grid-row: auto; | 14 grid-row: auto; |
15 grid-column: 1; | 15 grid-column: 1; |
16 } | 16 } |
17 | 17 |
18 #secondGridItem { | 18 #secondGridItem { |
19 grid-row: 1; | 19 grid-row: 1; |
20 grid-column: auto; | 20 grid-column: auto; |
21 } | 21 } |
22 | 22 |
23 #thirdGridItem { | 23 #thirdGridItem { |
24 grid-row: auto; | 24 grid-row: auto; |
25 grid-column: auto; | 25 grid-column: auto; |
26 } | 26 } |
27 </style> | 27 </style> |
28 <script> | 28 <script> |
29 function testGridDefinitions(gridDefinitionRows, gridDefinitionColumns, firstGri
dItemData, secondGridItemData, thirdGridItemData) | 29 function testGridDefinitions(gridTemplateRows, gridTemplateColumns, firstGridIte
mData, secondGridItemData, thirdGridItemData) |
30 { | 30 { |
31 var gridElement = document.getElementsByClassName("grid")[0]; | 31 var gridElement = document.getElementsByClassName("grid")[0]; |
32 gridElement.style.gridDefinitionRows = gridDefinitionRows; | 32 gridElement.style.gridTemplateRows = gridTemplateRows; |
33 gridElement.style.gridDefinitionColumns = gridDefinitionColumns; | 33 gridElement.style.gridTemplateColumns = gridTemplateColumns; |
34 | 34 |
35 var firstGridItem = document.getElementById("firstGridItem"); | 35 var firstGridItem = document.getElementById("firstGridItem"); |
36 firstGridItem.setAttribute("data-expected-width", firstGridItemData.width); | 36 firstGridItem.setAttribute("data-expected-width", firstGridItemData.width); |
37 firstGridItem.setAttribute("data-expected-height", firstGridItemData.height)
; | 37 firstGridItem.setAttribute("data-expected-height", firstGridItemData.height)
; |
38 firstGridItem.setAttribute("data-offset-x", firstGridItemData.x); | 38 firstGridItem.setAttribute("data-offset-x", firstGridItemData.x); |
39 firstGridItem.setAttribute("data-offset-y", firstGridItemData.y); | 39 firstGridItem.setAttribute("data-offset-y", firstGridItemData.y); |
40 | 40 |
41 var secondGridItem = document.getElementById("secondGridItem"); | 41 var secondGridItem = document.getElementById("secondGridItem"); |
42 secondGridItem.setAttribute("data-expected-width", secondGridItemData.width)
; | 42 secondGridItem.setAttribute("data-expected-width", secondGridItemData.width)
; |
43 secondGridItem.setAttribute("data-expected-height", secondGridItemData.heigh
t); | 43 secondGridItem.setAttribute("data-expected-height", secondGridItemData.heigh
t); |
(...skipping 25 matching lines...) Expand all Loading... |
69 <div style="position: relative"> | 69 <div style="position: relative"> |
70 <div class="grid"> | 70 <div class="grid"> |
71 <div class="sizedToGridArea" id="firstGridItem"></div> | 71 <div class="sizedToGridArea" id="firstGridItem"></div> |
72 <div class="sizedToGridArea" id="secondGridItem"></div> | 72 <div class="sizedToGridArea" id="secondGridItem"></div> |
73 <div class="sizedToGridArea" id="thirdGridItem"></div> | 73 <div class="sizedToGridArea" id="thirdGridItem"></div> |
74 </div> | 74 </div> |
75 </div> | 75 </div> |
76 | 76 |
77 </body> | 77 </body> |
78 </html> | 78 </html> |
OLD | NEW |