| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | 4 <script> |
| 5 if (window.testRunner) | 5 if (window.testRunner) |
| 6 testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1); | 6 testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1); |
| 7 </script> | 7 </script> |
| 8 <style> | 8 <style> |
| 9 .gridItemWithPositiveInteger { | 9 .gridItemWithPositiveInteger { |
| 10 -webkit-grid-start: 10; | 10 -webkit-grid-start: 10; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 -webkit-grid-before: 8 span; | 23 -webkit-grid-before: 8 span; |
| 24 } | 24 } |
| 25 .gridItemWithOnlySpan { | 25 .gridItemWithOnlySpan { |
| 26 -webkit-grid-start: span; | 26 -webkit-grid-start: span; |
| 27 -webkit-grid-before: span; | 27 -webkit-grid-before: span; |
| 28 } | 28 } |
| 29 .gridItemWithAuto { | 29 .gridItemWithAuto { |
| 30 -webkit-grid-start: auto; | 30 -webkit-grid-start: auto; |
| 31 -webkit-grid-before: auto; | 31 -webkit-grid-before: auto; |
| 32 } | 32 } |
| 33 .gridItemWithString { |
| 34 -webkit-grid-start: "first"; |
| 35 -webkit-grid-before: "last"; |
| 36 } |
| 37 .gridItemWithSpanString { |
| 38 -webkit-grid-start: "first" span; |
| 39 -webkit-grid-before: span "last"; |
| 40 } |
| 41 .gridItemWithSpanNumberString { |
| 42 -webkit-grid-start: 2 "first" span; |
| 43 -webkit-grid-before: "last" 3 span; |
| 44 } |
| 33 </style> | 45 </style> |
| 34 <script src="resources/grid-item-column-row-parsing-utils.js"></script> | 46 <script src="resources/grid-item-column-row-parsing-utils.js"></script> |
| 35 <script src="../js/resources/js-test-pre.js"></script> | 47 <script src="../js/resources/js-test-pre.js"></script> |
| 36 </head> | 48 </head> |
| 37 <body> | 49 <body> |
| 38 <!-- The first has no properties set on it. --> | 50 <!-- The first has no properties set on it. --> |
| 39 <div id="gridElement"></div> | 51 <div id="gridElement"></div> |
| 40 <div class="gridItemWithPositiveInteger" id="gridItemWithPositiveInteger"></div> | 52 <div class="gridItemWithPositiveInteger" id="gridItemWithPositiveInteger"></div> |
| 41 <div class="gridItemWithNegativeInteger" id="gridItemWithNegativeInteger"></div> | 53 <div class="gridItemWithNegativeInteger" id="gridItemWithNegativeInteger"></div> |
| 42 <div class="gridItemWithBeforeSpan" id="gridItemWithBeforeSpan"></div> | 54 <div class="gridItemWithBeforeSpan" id="gridItemWithBeforeSpan"></div> |
| 43 <div class="gridItemWithAfterSpan" id="gridItemWithAfterSpan"></div> | 55 <div class="gridItemWithAfterSpan" id="gridItemWithAfterSpan"></div> |
| 44 <div class="gridItemWithOnlySpan" id="gridItemWithOnlySpan"></div> | 56 <div class="gridItemWithOnlySpan" id="gridItemWithOnlySpan"></div> |
| 45 <div class="gridItemWithAuto" id="gridItemWithAutoElement"></div> | 57 <div class="gridItemWithAuto" id="gridItemWithAutoElement"></div> |
| 58 <div class="gridItemWithString" id="gridItemWithStringElement"></div> |
| 59 <div class="gridItemWithSpanString" id="gridItemWithSpanStringElement"></div> |
| 60 <div class="gridItemWithSpanNumberString" id="gridItemWithSpanNumberStringElemen
t"></div> |
| 46 <script> | 61 <script> |
| 47 description('Test that setting and getting grid-start and grid-before works
as expected'); | 62 description('Test that setting and getting grid-start and grid-before works
as expected'); |
| 48 | 63 |
| 49 debug("Test getting -webkit-grid-start and -webkit-grid-before set through C
SS"); | 64 debug("Test getting -webkit-grid-start and -webkit-grid-before set through C
SS"); |
| 50 var gridElement = document.getElementById("gridElement"); | 65 var gridElement = document.getElementById("gridElement"); |
| 51 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-s
tart')", "'auto'"); | 66 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-s
tart')", "'auto'"); |
| 52 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-c
olumn')", "'auto / auto'"); | 67 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-c
olumn')", "'auto / auto'"); |
| 53 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-b
efore')", "'auto'"); | 68 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-b
efore')", "'auto'"); |
| 54 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-r
ow')", "'auto / auto'"); | 69 shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-r
ow')", "'auto / auto'"); |
| 55 | 70 |
| 56 testColumnRowCSSParsing("gridItemWithPositiveInteger", "10 / auto", "15 / au
to"); | 71 testColumnRowCSSParsing("gridItemWithPositiveInteger", "10 / auto", "15 / au
to"); |
| 57 testColumnRowCSSParsing("gridItemWithNegativeInteger", "-10 / auto", "-15 /
auto"); | 72 testColumnRowCSSParsing("gridItemWithNegativeInteger", "-10 / auto", "-15 /
auto"); |
| 58 testColumnRowCSSParsing("gridItemWithBeforeSpan", "span 2 / auto", "span 8 /
auto"); | 73 testColumnRowCSSParsing("gridItemWithBeforeSpan", "span 2 / auto", "span 8 /
auto"); |
| 59 testColumnRowCSSParsing("gridItemWithAfterSpan", "span 2 / auto", "span 8 /
auto"); | 74 testColumnRowCSSParsing("gridItemWithAfterSpan", "span 2 / auto", "span 8 /
auto"); |
| 60 testColumnRowCSSParsing("gridItemWithOnlySpan", "span 1 / auto", "span 1 / a
uto"); | 75 testColumnRowCSSParsing("gridItemWithOnlySpan", "span 1 / auto", "span 1 / a
uto"); |
| 61 testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / au
to"); | 76 testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / au
to"); |
| 77 testColumnRowCSSParsing("gridItemWithStringElement", "1 first / auto", "1 la
st / auto"); |
| 78 testColumnRowCSSParsing("gridItemWithSpanStringElement", "span 1 first / aut
o", "span 1 last / auto"); |
| 79 testColumnRowCSSParsing("gridItemWithSpanNumberStringElement", "span 2 first
/ auto", "span 3 last / auto"); |
| 62 | 80 |
| 63 debug(""); | 81 debug(""); |
| 64 debug("Test the initial value"); | 82 debug("Test the initial value"); |
| 65 var element = document.createElement("div"); | 83 var element = document.createElement("div"); |
| 66 document.body.appendChild(element); | 84 document.body.appendChild(element); |
| 67 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-start
')", "'auto'"); | 85 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-start
')", "'auto'"); |
| 68 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-colum
n')", "'auto / auto'"); | 86 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-colum
n')", "'auto / auto'"); |
| 69 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-befor
e')", "'auto'"); | 87 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-befor
e')", "'auto'"); |
| 70 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')
", "'auto / auto'"); | 88 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')
", "'auto / auto'"); |
| 71 | 89 |
| 72 debug(""); | 90 debug(""); |
| 73 debug("Test getting and setting grid-start and grid-before through JS"); | 91 debug("Test getting and setting grid-start and grid-before through JS"); |
| 74 testStartBeforeJSParsing("18", "66"); | 92 testStartBeforeJSParsing("18", "66"); |
| 75 testStartBeforeJSParsing("-55", "-40"); | 93 testStartBeforeJSParsing("-55", "-40"); |
| 94 testStartBeforeJSParsing("'nav'", "'last'", "1 nav", "1 last"); |
| 76 testStartBeforeJSParsing("span 3", "span 20"); | 95 testStartBeforeJSParsing("span 3", "span 20"); |
| 96 testStartBeforeJSParsing("span 'nav'", "span 'last'", "span 1 nav", "span 1
last"); |
| 77 testStartBeforeJSParsing("auto", "auto"); | 97 testStartBeforeJSParsing("auto", "auto"); |
| 78 | 98 |
| 79 debug(""); | 99 debug(""); |
| 80 debug("Test setting grid-start and grid-before to 'inherit' through JS"); | 100 debug("Test setting grid-start and grid-before to 'inherit' through JS"); |
| 81 testStartBeforeInheritJSParsing("inherit", "18"); | 101 testStartBeforeInheritJSParsing("inherit", "18"); |
| 82 testStartBeforeInheritJSParsing("2", "inherit"); | 102 testStartBeforeInheritJSParsing("2", "inherit"); |
| 83 testStartBeforeInheritJSParsing("inherit", "inherit"); | 103 testStartBeforeInheritJSParsing("inherit", "inherit"); |
| 84 | 104 |
| 85 debug(""); | 105 debug(""); |
| 86 debug("Test setting grid-start and grid-before to 'initial' through JS"); | 106 debug("Test setting grid-start and grid-before to 'initial' through JS"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 97 element.style.webkitGridStart = "auto"; | 117 element.style.webkitGridStart = "auto"; |
| 98 element.style.webkitGridBefore = "auto"; | 118 element.style.webkitGridBefore = "auto"; |
| 99 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-start
')", "'auto'"); | 119 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-start
')", "'auto'"); |
| 100 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-colum
n')", "'auto / auto'"); | 120 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-colum
n')", "'auto / auto'"); |
| 101 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-befor
e')", "'auto'"); | 121 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-befor
e')", "'auto'"); |
| 102 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')
", "'auto / auto'"); | 122 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')
", "'auto / auto'"); |
| 103 </script> | 123 </script> |
| 104 <script src="../js/resources/js-test-post.js"></script> | 124 <script src="../js/resources/js-test-post.js"></script> |
| 105 </body> | 125 </body> |
| 106 </html> | 126 </html> |
| OLD | NEW |