| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div id="testContainer"> | 4 <div id="testContainer"> |
| 5 <div id="outer"> | 5 <div id="outer"> |
| 6 <div id="inner"> | 6 <div id="inner"> |
| 7 <div id="innermost"></div> | 7 <div id="innermost"></div> |
| 8 </div> | 8 </div> |
| 9 </div> | 9 </div> |
| 10 </div> | 10 </div> |
| 11 <script> | 11 <script> |
| 12 | 12 |
| 13 // TODO(napper): Generate this table from CSSProperties.in. | 13 // TODO(napper): Generate this table from CSSProperties.in. |
| 14 var independent_properties = [ | 14 var independent_properties = [ |
| 15 // [Property name, [list of valid keywords]]. Each keyword is tested in cons
ecutive pairs. | 15 // [Property name, [list of valid keywords]]. Each keyword is tested in cons
ecutive pairs. |
| 16 ["pointerEvents", ["none", "auto", "stroke", "fill", "painted", "visible", "
visibleStroke", "visibleFill", "visiblePainted", "bounding-box", "all"]], | 16 ["pointerEvents", ["none", "auto", "stroke", "fill", "painted", "visible", "
visibleStroke", "visibleFill", "visiblePainted", "bounding-box", "all"]], |
| 17 ["visibility", ["visible", "hidden", "collapse"]], | 17 ["visibility", ["visible", "hidden", "collapse"]], |
| 18 ["whiteSpace", ["normal", "pre", "pre-wrap", "pre-line", "nowrap"]], | 18 ["whiteSpace", ["normal", "pre", "pre-wrap", "pre-line", "nowrap"]], |
| 19 ["borderCollapse", ["separate", "collapse"]], | 19 ["borderCollapse", ["separate", "collapse"]], |
| 20 ["emptyCells", ["show", "hide"]], | 20 ["emptyCells", ["show", "hide"]], |
| 21 ["captionSide", ["top", "bottom", "left", "right"]], | 21 ["captionSide", ["top", "bottom"]], |
| 22 ["listStylePosition", ["outside", "inside"]], | 22 ["listStylePosition", ["outside", "inside"]], |
| 23 ["webkitBoxDirection", ["normal", "reverse"]], | 23 ["webkitBoxDirection", ["normal", "reverse"]], |
| 24 ["webkitPrintColorAdjust", ["economy", "exact"]], | 24 ["webkitPrintColorAdjust", ["economy", "exact"]], |
| 25 ["textTransform", ["capitalize", "uppercase", "lowercase", "none"]], | 25 ["textTransform", ["capitalize", "uppercase", "lowercase", "none"]], |
| 26 ["webkitRtlOrdering", ["logical", "visual"]], | 26 ["webkitRtlOrdering", ["logical", "visual"]], |
| 27 ["textAlign", ["start", "left"]], | 27 ["textAlign", ["start", "left"]], |
| 28 ]; | 28 ]; |
| 29 | 29 |
| 30 independent_properties.forEach(function(test_data) | 30 independent_properties.forEach(function(test_data) |
| 31 { | 31 { |
| 32 var propertyName = test_data[0]; | 32 var propertyName = test_data[0]; |
| 33 var keywords = test_data[1]; | 33 var keywords = test_data[1]; |
| 34 var num_keywords = keywords.length; | 34 var num_keywords = keywords.length; |
| 35 // Tests style change propagation for each keyword, verifying there is only
a single | 35 // Tests style change propagation for each keyword, verifying there is only
a single |
| 36 // style recalc. | 36 // style recalc. |
| 37 for (i = 0; i < num_keywords; i++) { | 37 for (i = 0; i < num_keywords; i++) { |
| 38 var value1 = keywords[i]; | 38 var value1 = keywords[i]; |
| 39 // Use the next keyword in the list, or if it is the last one, wrap arou
nd and | 39 // Use the next keyword in the list, or if it is the last one, wrap arou
nd and |
| 40 // use the first. | 40 // use the first. |
| 41 var value2 = keywords[(i + 1) % num_keywords]; | 41 var value2 = keywords[(i + 1) % num_keywords]; |
| 42 | 42 |
| 43 test(function(t) | 43 test(function(t) |
| 44 { | 44 { |
| 45 if (!window.internals) | 45 if (!window.internals) |
| 46 assert_unreached('This test requires window.internals.'); | 46 assert_unreached('This test requires window.internals.'); |
| 47 | 47 |
| 48 // Create a nested div structure for the test. | 48 // Create a nested div structure for the test. |
| 49 var outer = document.createElement("div"); | 49 var outer = document.createElement("div"); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 assert_equals(getComputedStyle(inner)[propertyName], value2); | 93 assert_equals(getComputedStyle(inner)[propertyName], value2); |
| 94 assert_equals(getComputedStyle(innermost)[propertyName], value2); | 94 assert_equals(getComputedStyle(innermost)[propertyName], value2); |
| 95 outer.offsetTop; // Force recalc. | 95 outer.offsetTop; // Force recalc. |
| 96 | 96 |
| 97 // Clear for next test. | 97 // Clear for next test. |
| 98 outer.remove(); | 98 outer.remove(); |
| 99 }, "Changing " + propertyName + ", an independent inherited property, pr
opagates correctly with a single style recalc."); | 99 }, "Changing " + propertyName + ", an independent inherited property, pr
opagates correctly with a single style recalc."); |
| 100 } | 100 } |
| 101 }) | 101 }) |
| 102 </script> | 102 </script> |
| OLD | NEW |