OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link href="resources/grid.css" rel="stylesheet"> | 4 <link href="resources/grid.css" rel="stylesheet"> |
5 <style> | 5 <style> |
6 .grid { | 6 .grid { |
7 grid-template-areas: "firstArea secondArea" | 7 grid-template-areas: "firstArea secondArea" |
8 "thirdArea thirdArea"; | 8 "thirdArea thirdArea"; |
9 } | 9 } |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 grid-row-end: span last; | 45 grid-row-end: span last; |
46 } | 46 } |
47 .gridItemWithSpanNumberCustomIdent { | 47 .gridItemWithSpanNumberCustomIdent { |
48 grid-column-end: 2 first span; | 48 grid-column-end: 2 first span; |
49 grid-row-end: last 3 span; | 49 grid-row-end: last 3 span; |
50 } | 50 } |
51 .gridItemWithArea { | 51 .gridItemWithArea { |
52 grid-column-end: firstArea; | 52 grid-column-end: firstArea; |
53 grid-row-end: thirdArea; | 53 grid-row-end: thirdArea; |
54 } | 54 } |
| 55 .gridItemWithCSSWideKeyword { |
| 56 grid-column-end: 2 inherit; |
| 57 grid-row-end: 2 initial; |
| 58 } |
| 59 .gridItemWithCSSWideKeyword2 { |
| 60 grid-column-end: 2 unset; |
| 61 grid-row-end: 2 default; |
| 62 } |
| 63 .gridItemWithSpanAuto { |
| 64 grid-column-end: span auto; |
| 65 grid-row-end: auto span; |
| 66 } |
55 </style> | 67 </style> |
56 <script src="resources/grid-item-column-row-parsing-utils.js"></script> | 68 <script src="resources/grid-item-column-row-parsing-utils.js"></script> |
57 <script src="../../resources/js-test.js"></script> | 69 <script src="../../resources/js-test.js"></script> |
58 </head> | 70 </head> |
59 <body> | 71 <body> |
60 <div class="grid"> | 72 <div class="grid"> |
61 <!-- The first has no properties set on it. --> | 73 <!-- The first has no properties set on it. --> |
62 <div id="gridElement"></div> | 74 <div id="gridElement"></div> |
63 <div class="gridItemWithPositiveInteger" id="gridItemWithPositiveInteger"></
div> | 75 <div class="gridItemWithPositiveInteger" id="gridItemWithPositiveInteger"></
div> |
64 <div class="gridItemWithNegativeInteger" id="gridItemWithNegativeInteger"></
div> | 76 <div class="gridItemWithNegativeInteger" id="gridItemWithNegativeInteger"></
div> |
65 <div class="gridItemWithBeforeSpan" id="gridItemWithBeforeSpan"></div> | 77 <div class="gridItemWithBeforeSpan" id="gridItemWithBeforeSpan"></div> |
66 <div class="gridItemWithAfterSpan" id="gridItemWithAfterSpan"></div> | 78 <div class="gridItemWithAfterSpan" id="gridItemWithAfterSpan"></div> |
67 <div class="gridItemWithOnlySpan" id="gridItemWithOnlySpan"></div> | 79 <div class="gridItemWithOnlySpan" id="gridItemWithOnlySpan"></div> |
68 <div class="gridItemWithAuto" id="gridItemWithAutoElement"></div> | 80 <div class="gridItemWithAuto" id="gridItemWithAutoElement"></div> |
69 <div class="gridItemWithCustomIdent" id="gridItemWithCustomIdent"></div> | 81 <div class="gridItemWithCustomIdent" id="gridItemWithCustomIdent"></div> |
70 <div class="gridItemWithNumberCustomIdent" id="gridItemWithNumberCustomIdent
"></div> | 82 <div class="gridItemWithNumberCustomIdent" id="gridItemWithNumberCustomIdent
"></div> |
71 <div class="gridItemWithSpanCustomIdent" id="gridItemWithSpanCustomIdentElem
ent"></div> | 83 <div class="gridItemWithSpanCustomIdent" id="gridItemWithSpanCustomIdentElem
ent"></div> |
72 <div class="gridItemWithSpanNumberCustomIdent" id="gridItemWithSpanNumberCus
tomIdentElement"></div> | 84 <div class="gridItemWithSpanNumberCustomIdent" id="gridItemWithSpanNumberCus
tomIdentElement"></div> |
73 <div class="gridItemWithArea" id="gridItemWithArea"></div> | 85 <div class="gridItemWithArea" id="gridItemWithArea"></div> |
| 86 <div class="gridItemWithCSSWideKeyword" id="gridItemWithCSSWideKeyword"></di
v> |
| 87 <div class="gridItemWithCSSWideKeyword2" id="gridItemWithCSSWideKeyword2"></
div> |
| 88 <div class="gridItemWithSpanAuto" id="gridItemWithSpanAuto"></div> |
74 </div> | 89 </div> |
75 <script> | 90 <script> |
76 description('Test that setting and getting grid-column-end and grid-row-end
works as expected'); | 91 description('Test that setting and getting grid-column-end and grid-row-end
works as expected'); |
77 | 92 |
78 debug("Test getting grid-column-end and grid-row-end set through CSS"); | 93 debug("Test getting grid-column-end and grid-row-end set through CSS"); |
79 testColumnRowCSSParsing("gridElement", "auto / auto", "auto / auto"); | 94 testColumnRowCSSParsing("gridElement", "auto / auto", "auto / auto"); |
80 testColumnRowCSSParsing("gridItemWithPositiveInteger", "auto / 10", "auto /
15"); | 95 testColumnRowCSSParsing("gridItemWithPositiveInteger", "auto / 10", "auto /
15"); |
81 testColumnRowCSSParsing("gridItemWithNegativeInteger", "auto / -10", "auto /
-15"); | 96 testColumnRowCSSParsing("gridItemWithNegativeInteger", "auto / -10", "auto /
-15"); |
82 testColumnRowCSSParsing("gridItemWithBeforeSpan", "auto / span 2", "auto / s
pan 9"); | 97 testColumnRowCSSParsing("gridItemWithBeforeSpan", "auto / span 2", "auto / s
pan 9"); |
83 testColumnRowCSSParsing("gridItemWithAfterSpan", "auto / span 2", "auto / sp
an 9"); | 98 testColumnRowCSSParsing("gridItemWithAfterSpan", "auto / span 2", "auto / sp
an 9"); |
84 testColumnRowCSSParsing("gridItemWithOnlySpan", "auto / span 1", "auto / spa
n 1"); | 99 testColumnRowCSSParsing("gridItemWithOnlySpan", "auto / span 1", "auto / spa
n 1"); |
85 testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / au
to"); | 100 testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / au
to"); |
86 testColumnRowCSSParsing("gridItemWithCustomIdent", "auto / first", "auto / l
ast"); | 101 testColumnRowCSSParsing("gridItemWithCustomIdent", "auto / first", "auto / l
ast"); |
87 testColumnRowCSSParsing("gridItemWithNumberCustomIdent", "auto / 2 first", "
auto / 3 last"); | 102 testColumnRowCSSParsing("gridItemWithNumberCustomIdent", "auto / 2 first", "
auto / 3 last"); |
88 testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "auto / span 1
first", "auto / span 1 last"); | 103 testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "auto / span 1
first", "auto / span 1 last"); |
89 testColumnRowCSSParsing("gridItemWithSpanNumberCustomIdentElement", "auto /
span 2 first", "auto / span 3 last"); | 104 testColumnRowCSSParsing("gridItemWithSpanNumberCustomIdentElement", "auto /
span 2 first", "auto / span 3 last"); |
90 testColumnRowCSSParsing("gridItemWithArea", "auto / firstArea", "auto / thir
dArea"); | 105 testColumnRowCSSParsing("gridItemWithArea", "auto / firstArea", "auto / thir
dArea"); |
| 106 testColumnRowCSSParsing("gridItemWithCSSWideKeyword", "auto / auto", "auto /
auto"); |
| 107 testColumnRowCSSParsing("gridItemWithCSSWideKeyword2", "auto / auto", "auto
/ auto"); |
| 108 testColumnRowCSSParsing("gridItemWithSpanAuto", "auto / auto", "auto / auto"
); |
91 | 109 |
92 debug(""); | 110 debug(""); |
93 debug("Test the initial value"); | 111 debug("Test the initial value"); |
94 var element = document.createElement("div"); | 112 var element = document.createElement("div"); |
95 document.body.appendChild(element); | 113 document.body.appendChild(element); |
96 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column-end')"
, "'auto'"); | 114 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column-end')"
, "'auto'"); |
97 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column')", "'
auto / auto'"); | 115 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column')", "'
auto / auto'"); |
98 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row-end')", "
'auto'"); | 116 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row-end')", "
'auto'"); |
99 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / auto'"); | 117 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / auto'"); |
100 | 118 |
(...skipping 29 matching lines...) Expand all Loading... |
130 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / 66'"); | 148 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / 66'"); |
131 element.style.gridColumnEnd = "auto"; | 149 element.style.gridColumnEnd = "auto"; |
132 element.style.gridRowEnd = "auto"; | 150 element.style.gridRowEnd = "auto"; |
133 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column-end')"
, "'auto'"); | 151 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column-end')"
, "'auto'"); |
134 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column')", "'
auto / auto'"); | 152 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-column')", "'
auto / auto'"); |
135 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row-end')", "
'auto'"); | 153 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row-end')", "
'auto'"); |
136 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / auto'"); | 154 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-row')", "'aut
o / auto'"); |
137 </script> | 155 </script> |
138 </body> | 156 </body> |
139 </html> | 157 </html> |
OLD | NEW |