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

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

Issue 2117143003: Add a fast-path for independent inherited properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computedstyle_cleanup_rename_final_member_fields
Patch Set: Small rename Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-multiple-properties.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-multiple-properties.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-multiple-properties.html
new file mode 100644
index 0000000000000000000000000000000000000000..634a8f197389397c6ecc453a487af56430e81b10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/independent-inheritance-fast-path-multiple-properties.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+#c {
+ pointer-events: all;
+}
+#e {
+ visibility: collapse;
+}
+</style>
+<div id="a">
+ <div id="b">
+ <div id="c">
+ <div id="d">
+ <div id="e">
+ <div id="f">
meade_UTC10 2016/07/13 07:29:12 Is it necessary to do so many levels of nesting he
sashab 2016/07/14 05:08:41 That's a good question! Added comments to explain
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+test(function(t)
+{
+ if (!window.internals)
+ assert_unreached('This test requires window.internals.');
+
+ a.offsetTop; // Force recalc.
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 0);
+
+ assert_equals(getComputedStyle(a).pointerEvents, "auto");
+ assert_equals(getComputedStyle(b).pointerEvents, "auto");
+ assert_equals(getComputedStyle(c).pointerEvents, "all");
+ assert_equals(getComputedStyle(d).pointerEvents, "all");
+ assert_equals(getComputedStyle(e).pointerEvents, "all");
+ assert_equals(getComputedStyle(f).pointerEvents, "all");
+ assert_equals(getComputedStyle(a).visibility, "visible");
+ assert_equals(getComputedStyle(b).visibility, "visible");
+ assert_equals(getComputedStyle(c).visibility, "visible");
+ assert_equals(getComputedStyle(d).visibility, "visible");
+ assert_equals(getComputedStyle(e).visibility, "collapse");
+ assert_equals(getComputedStyle(f).visibility, "collapse");
+
+ a.offsetTop; // Force recalc.
+ a.style.pointerEvents = "none";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
+
+ a.offsetTop; // Force recalc.
+ a.style.visibility = "hidden";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
+
+ assert_equals(getComputedStyle(a).pointerEvents, "none");
+ assert_equals(getComputedStyle(b).pointerEvents, "none");
+ assert_equals(getComputedStyle(c).pointerEvents, "all");
+ assert_equals(getComputedStyle(d).pointerEvents, "all");
+ assert_equals(getComputedStyle(e).pointerEvents, "all");
+ assert_equals(getComputedStyle(f).pointerEvents, "all");
+ assert_equals(getComputedStyle(a).visibility, "hidden");
+ assert_equals(getComputedStyle(b).visibility, "hidden");
+ assert_equals(getComputedStyle(c).visibility, "hidden");
+ assert_equals(getComputedStyle(d).visibility, "hidden");
+ assert_equals(getComputedStyle(e).visibility, "collapse");
+ assert_equals(getComputedStyle(f).visibility, "collapse");
+
+ a.offsetTop; // Force recalc.
+ d.style.pointerEvents = "painted";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
+
+ a.offsetTop; // Force recalc.
+ e.style.visibility = "visible";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
+
+ assert_equals(getComputedStyle(a).pointerEvents, "none");
+ assert_equals(getComputedStyle(b).pointerEvents, "none");
+ assert_equals(getComputedStyle(c).pointerEvents, "all");
+ assert_equals(getComputedStyle(d).pointerEvents, "painted");
+ assert_equals(getComputedStyle(e).pointerEvents, "painted");
+ assert_equals(getComputedStyle(f).pointerEvents, "painted");
+ assert_equals(getComputedStyle(a).visibility, "hidden");
+ assert_equals(getComputedStyle(b).visibility, "hidden");
+ assert_equals(getComputedStyle(c).visibility, "hidden");
+ assert_equals(getComputedStyle(d).visibility, "hidden");
+ assert_equals(getComputedStyle(e).visibility, "visible");
+ assert_equals(getComputedStyle(f).visibility, "visible");
+}, "Changing both pointer-events and visibility on an element, both independent inherited properties, doesn't cause a style recalc for its children.");
+</script>

Powered by Google App Engine
This is Rietveld 408576698