| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 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 <link href="resources/grid.css" rel="stylesheet"> | 8 <link href="resources/grid.css" rel="stylesheet"> |
| 9 <style> | 9 <style> |
| 10 .grid { | 10 .grid { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 grid-definition-rows: repeat(2, auto); | 36 grid-definition-rows: repeat(2, auto); |
| 37 grid-definition-columns: repeat(2, minmax(15px, 50%)); | 37 grid-definition-columns: repeat(2, minmax(15px, 50%)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 .twoDoubleTrackRepeat { | 40 .twoDoubleTrackRepeat { |
| 41 grid-definition-rows: repeat(2, minmax(5px, 10px) auto); | 41 grid-definition-rows: repeat(2, minmax(5px, 10px) auto); |
| 42 grid-definition-columns: repeat(2, auto minmax(100px, 120px)); | 42 grid-definition-columns: repeat(2, auto minmax(100px, 120px)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 .twoDoubleTrackWithNamedGridLineRepeat { | 45 .twoDoubleTrackWithNamedGridLineRepeat { |
| 46 grid-definition-rows: repeat(2, 10px 'start' auto 'end'); | 46 grid-definition-rows: repeat(2, 10px (start) auto (end)); |
| 47 grid-definition-columns: repeat(2, auto 'middle' 250px 'end'); | 47 grid-definition-columns: repeat(2, auto (middle) 250px (end)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 .twoDoubleTrackWithTrailingNamedGridLineRepeat { | 50 .twoDoubleTrackWithTrailingNamedGridLineRepeat { |
| 51 grid-definition-rows: repeat(2, 'before' 10px); | 51 grid-definition-rows: repeat(2, (before) 10px); |
| 52 grid-definition-columns: repeat(2, 'before' auto); | 52 grid-definition-columns: repeat(2, (before) auto); |
| 53 } | 53 } |
| 54 | 54 |
| 55 .trailingNamedGridLineRepeat { | 55 .trailingNamedGridLineRepeat { |
| 56 grid-definition-rows: repeat(1, 10px) 'end'; | 56 grid-definition-rows: repeat(1, 10px) (end); |
| 57 grid-definition-columns: repeat(1, 250px) 'end'; | 57 grid-definition-columns: repeat(1, 250px) (end); |
| 58 } | 58 } |
| 59 | 59 |
| 60 .leadingNamedGridLineRepeat { | 60 .leadingNamedGridLineRepeat { |
| 61 grid-definition-rows: 'start' repeat(2, 10px); | 61 grid-definition-rows: (start) repeat(2, 10px); |
| 62 grid-definition-columns: 'start' repeat(2, 250px); | 62 grid-definition-columns: (start) repeat(2, 250px); |
| 63 } | 63 } |
| 64 | 64 |
| 65 .mixRepeatAfterNonRepeat { | 65 .mixRepeatAfterNonRepeat { |
| 66 grid-definition-rows: auto repeat(2, 10px); | 66 grid-definition-rows: auto repeat(2, 10px); |
| 67 grid-definition-columns: 'start' 140px repeat(2, 250px); | 67 grid-definition-columns: (start) 140px repeat(2, 250px); |
| 68 } | 68 } |
| 69 | 69 |
| 70 .mixNonRepeatAfterRepeat { | 70 .mixNonRepeatAfterRepeat { |
| 71 grid-definition-rows: repeat(2, 10px) 'end' auto; | 71 grid-definition-rows: repeat(2, 10px) (end) auto; |
| 72 grid-definition-columns: repeat(2, 250px) 15% 'last'; | 72 grid-definition-columns: repeat(2, 250px) 15% (last); |
| 73 } | 73 } |
| 74 </style> | 74 </style> |
| 75 <script src="../../resources/js-test.js"></script> | 75 <script src="../../resources/js-test.js"></script> |
| 76 </head> | 76 </head> |
| 77 <body> | 77 <body> |
| 78 <div class="grid singleSingleTrackRepeat" id="singleSingleTrackRepeatWithSize"><
/div> | 78 <div class="grid singleSingleTrackRepeat" id="singleSingleTrackRepeatWithSize"><
/div> |
| 79 <div class="grid twoSingleTrackRepeat" id="twoSingleTrackRepeat"></div> | 79 <div class="grid twoSingleTrackRepeat" id="twoSingleTrackRepeat"></div> |
| 80 <div class="grid twoSingleTrackRepeat" id="twoSingleTrackRepeatWithChildren"> | 80 <div class="grid twoSingleTrackRepeat" id="twoSingleTrackRepeatWithChildren"> |
| 81 <div class="gridItem"></div> | 81 <div class="gridItem"></div> |
| 82 <div class="gridItem2"></div> | 82 <div class="gridItem2"></div> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 99 | 99 |
| 100 <script src="resources/grid-definitions-parsing-utils.js"></script> | 100 <script src="resources/grid-definitions-parsing-utils.js"></script> |
| 101 <script> | 101 <script> |
| 102 description('Test that setting and getting grid-definition-columns and grid-
definition-rows with repeat() works as expected'); | 102 description('Test that setting and getting grid-definition-columns and grid-
definition-rows with repeat() works as expected'); |
| 103 | 103 |
| 104 debug("Test getting grid-definition-columns and grid-definition-rows set thr
ough CSS"); | 104 debug("Test getting grid-definition-columns and grid-definition-rows set thr
ough CSS"); |
| 105 testGridDefinitionsValues(document.getElementById("singleSingleTrackRepeatWi
thSize"), "120px", "18px"); | 105 testGridDefinitionsValues(document.getElementById("singleSingleTrackRepeatWi
thSize"), "120px", "18px"); |
| 106 testGridDefinitionsValues(document.getElementById("twoSingleTrackRepeat"), "
400px 400px", "0px 0px"); | 106 testGridDefinitionsValues(document.getElementById("twoSingleTrackRepeat"), "
400px 400px", "0px 0px"); |
| 107 testGridDefinitionsValues(document.getElementById("twoSingleTrackRepeatWithC
hildren"), "400px 400px", "44px 77px"); | 107 testGridDefinitionsValues(document.getElementById("twoSingleTrackRepeatWithC
hildren"), "400px 400px", "44px 77px"); |
| 108 testGridDefinitionsValues(document.getElementById("twoDoubleTrackRepeat"), "
33px 120px 0px 120px", "10px 77px 10px 0px"); | 108 testGridDefinitionsValues(document.getElementById("twoDoubleTrackRepeat"), "
33px 120px 0px 120px", "10px 77px 10px 0px"); |
| 109 testGridDefinitionsValues(document.getElementById("twoDoubleTrackWithNamedGr
idLineRepeat"), "33px middle 250px end 0px middle 250px end", "10px start 77px e
nd 10px start 0px end"); | 109 testGridDefinitionsValues(document.getElementById("twoDoubleTrackWithNamedGr
idLineRepeat"), "33px (middle) 250px (end) 0px (middle) 250px (end)", "10px (sta
rt) 77px (end) 10px (start) 0px (end)"); |
| 110 testGridDefinitionsValues(document.getElementById("twoDoubleTrackWithTrailin
gNamedGridLineRepeat"), "before 0px before 0px", "before 10px before 10px"); | 110 testGridDefinitionsValues(document.getElementById("twoDoubleTrackWithTrailin
gNamedGridLineRepeat"), "(before) 0px (before) 0px", "(before) 10px (before) 10p
x"); |
| 111 testGridDefinitionsValues(document.getElementById("trailingNamedGridLineRepe
at"), "250px end", "10px end"); | 111 testGridDefinitionsValues(document.getElementById("trailingNamedGridLineRepe
at"), "250px (end)", "10px (end)"); |
| 112 testGridDefinitionsValues(document.getElementById("leadingNamedGridLineRepea
t"), "start 250px 250px", "start 10px 10px"); | 112 testGridDefinitionsValues(document.getElementById("leadingNamedGridLineRepea
t"), "(start) 250px 250px", "(start) 10px 10px"); |
| 113 testGridDefinitionsValues(document.getElementById("mixRepeatAfterNonRepeat")
, "start 140px 250px 250px", "44px 10px 10px"); | 113 testGridDefinitionsValues(document.getElementById("mixRepeatAfterNonRepeat")
, "(start) 140px 250px 250px", "44px 10px 10px"); |
| 114 testGridDefinitionsValues(document.getElementById("mixNonRepeatAfterRepeat")
, "250px 250px 120px last", "10px 10px end 0px"); | 114 testGridDefinitionsValues(document.getElementById("mixNonRepeatAfterRepeat")
, "250px 250px 120px (last)", "10px 10px (end) 0px"); |
| 115 | 115 |
| 116 debug(""); | 116 debug(""); |
| 117 debug("Test invalid repeat syntax."); | 117 debug("Test invalid repeat syntax."); |
| 118 function testInvalidSyntax(gridColumn) { | 118 function testInvalidSyntax(gridColumn) { |
| 119 element = document.createElement("div"); | 119 element = document.createElement("div"); |
| 120 document.body.appendChild(element); | 120 document.body.appendChild(element); |
| 121 element.style.gridDefinitionColumns = gridColumn; | 121 element.style.gridDefinitionColumns = gridColumn; |
| 122 shouldBeEqualToString("window.getComputedStyle(element, '').getPropertyV
alue('grid-definition-columns')", "none"); | 122 shouldBeEqualToString("window.getComputedStyle(element, '').getPropertyV
alue('grid-definition-columns')", "none"); |
| 123 document.body.removeChild(element); | 123 document.body.removeChild(element); |
| 124 } | 124 } |
| 125 testInvalidSyntax("repeat("); | 125 testInvalidSyntax("repeat("); |
| 126 testInvalidSyntax("repeat()"); | 126 testInvalidSyntax("repeat()"); |
| 127 testInvalidSyntax("repeat(3 / auto)"); | 127 testInvalidSyntax("repeat(3 / auto)"); |
| 128 testInvalidSyntax("repeat(3 , ,)"); | 128 testInvalidSyntax("repeat(3 , ,)"); |
| 129 testInvalidSyntax("repeat(0, 15px)"); | 129 testInvalidSyntax("repeat(0, 15px)"); |
| 130 testInvalidSyntax("repeat(-1, auto)"); | 130 testInvalidSyntax("repeat(-1, auto)"); |
| 131 // Nesting is no allowed. | 131 // Nesting is no allowed. |
| 132 testInvalidSyntax("repeat(2, repeat(1, auto))"); | 132 testInvalidSyntax("repeat(2, repeat(1, auto))"); |
| 133 </script> | 133 </script> |
| 134 </body> | 134 </body> |
| 135 </html> | 135 </html> |
| OLD | NEW |