Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html

Issue 2620383008: Updated independent-inheritance-fast-path.html to test all keywords. (Closed)
Patch Set: Added TODO to generate properties table from CSSProperties.in. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html
index 8afe9598fe42f2eb3c4caf12aee456337cf14fb7..92763bbbf67ba117dc8942abbedd2b183bdf7842 100644
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path.html
@@ -10,72 +10,81 @@
</div>
<script>
+// TODO(napper): Generate this table from CSSProperties.in.
var independent_properties = [
// Property name, Value 1, Value 2
sashab 2017/01/13 02:03:37 Change this to // Property name, [list of valid k
- ["pointerEvents", "auto", "all"],
- ["visibility", "visible", "hidden"],
- ["whiteSpace", "normal", "nowrap"],
- ["borderCollapse", "separate", "collapse"],
- ["emptyCells", "show", "hide"],
- ["captionSide", "left", "right"],
- ["listStylePosition", "outside", "inside"],
- ["webkitBoxDirection", "normal", "reverse"],
- ["webkitPrintColorAdjust", "economy", "exact"],
- ["textTransform", "capitalize", "uppercase"],
- ["webkitRtlOrdering", "logical", "visual"],
+ ["pointerEvents", ["none", "auto", "stroke", "fill", "painted", "visible", "visibleStroke", "visibleFill", "visiblePainted", "bounding-box", "all"]],
+ ["visibility", ["visible", "hidden", "collapse"]],
+ ["whiteSpace", ["normal", "pre", "pre-wrap", "pre-line", "nowrap"]],
+ ["borderCollapse", ["separate", "collapse"]],
+ ["emptyCells", ["show", "hide"]],
+ ["captionSide", ["top", "bottom", "left", "right"]],
+ ["listStylePosition", ["outside", "inside"]],
+ ["webkitBoxDirection", ["normal", "reverse"]],
+ ["webkitPrintColorAdjust", ["economy", "exact"]],
+ ["textTransform", ["capitalize", "uppercase", "lowercase", "none"]],
+ ["webkitRtlOrdering", ["logical", "visual"]],
];
independent_properties.forEach(function(test_data)
{
var propertyName = test_data[0];
- var value1 = test_data[1];
- var value2 = test_data[2];
+ var keywords = test_data[1];
+ var num_keywords = keywords.length;
+ // Tests style change propagation for each keyword, verifying there is only a single
+ // style recalc.
+ for (i = 0; i < num_keywords; i++) {
+ var value1 = keywords[i];
+ // Use the next keyword in the list, or if it is the last one, wrap around and
+ // use the first.
+ var value2 = keywords[(i + 1) % num_keywords];
- test(function(t)
- {
- if (!window.internals)
- assert_unreached('This test requires window.internals.');
+ test(function(t)
+ {
+ if (!window.internals)
+ assert_unreached('This test requires window.internals.');
- // Create a nested div structure for the test.
- var outer = document.createElement("div");
- var inner = document.createElement("div");
- var innermost = document.createElement("div");
- testContainer.appendChild(outer);
- outer.appendChild(inner);
- inner.appendChild(innermost);
+ // Create a nested div structure for the test.
+ var outer = document.createElement("div");
+ var inner = document.createElement("div");
+ var innermost = document.createElement("div");
+ testContainer.appendChild(outer);
+ outer.appendChild(inner);
+ inner.appendChild(innermost);
- outer.offsetTop; // Force recalc.
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0);
+ outer.offsetTop; // Force recalc.
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0);
- // Set the whole container to the first value.
- testContainer.style[propertyName] = value1;
+ // Set the whole container to the first value.
+ testContainer.style[propertyName] = value1;
- // All elements start as the first value.
- assert_equals(getComputedStyle(outer)[propertyName], value1);
- assert_equals(getComputedStyle(inner)[propertyName], value1);
- assert_equals(getComputedStyle(innermost)[propertyName], value1);
- outer.offsetTop; // Force recalc.
+ // All elements start as the first value.
+ assert_equals(getComputedStyle(outer)[propertyName], value1);
+ assert_equals(getComputedStyle(inner)[propertyName], value1);
+ assert_equals(getComputedStyle(innermost)[propertyName], value1);
+ outer.offsetTop; // Force recalc.
- // Changing outer also changes inner and innermost.
- outer.style[propertyName] = value2;
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Only outer should be recalced (3 without fast path)");
+ // Changing outer also changes inner and innermost.
+ outer.style[propertyName] = value2;
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Only outer should be recalced (3 without fast path)");
- assert_equals(getComputedStyle(outer)[propertyName], value2);
- assert_equals(getComputedStyle(inner)[propertyName], value2);
- assert_equals(getComputedStyle(innermost)[propertyName], value2);
- outer.offsetTop; // Force recalc.
+ assert_equals(getComputedStyle(outer)[propertyName], value2);
+ assert_equals(getComputedStyle(inner)[propertyName], value2);
+ assert_equals(getComputedStyle(innermost)[propertyName], value2);
+ outer.offsetTop; // Force recalc.
- // Changing inner to value1 changes all its children to that value.
- inner.style[propertyName] = value1;
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Only inner should be recalced (2 without fast path)");
+ // Changing inner to value1 changes all its children to that value.
+ inner.style[propertyName] = value1;
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Only inner should be recalced (2 without fast path)");
- assert_equals(getComputedStyle(outer)[propertyName], value2);
- assert_equals(getComputedStyle(inner)[propertyName], value1);
- assert_equals(getComputedStyle(innermost)[propertyName], value1);
- outer.offsetTop; // Force recalc.
+ assert_equals(getComputedStyle(outer)[propertyName], value2);
+ assert_equals(getComputedStyle(inner)[propertyName], value1);
+ assert_equals(getComputedStyle(innermost)[propertyName], value1);
+ outer.offsetTop; // Force recalc.
- // Clear for next test.
- outer.remove();
- }, "Changing " + propertyName + ", an independent inherited property, propagates correctly with a single style recalc.");
+ // Clear for next test.
+ outer.remove();
+ }, "Changing " + propertyName + ", an independent inherited property, propagates correctly with a single style recalc.");
+ }
})
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698