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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule.html

Issue 1368313005: Missing clear() for pseudo invalidation sets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule.html
new file mode 100644
index 0000000000000000000000000000000000000000..8e4d5a28859124a3323c09ceb413b042924f22f4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+#match { background-color: red }
+#hover:hover #match { background-color: green }
+</style>
+<div id="hover">
+ Hover this text ...
+ <span></span>
+ <span></span>
+ <span></span>
+ <span></span>
+ <span id="match"> and this should have a green background.</span>
+</div>
+<div id="host"></div>
+<script>
+description("Removing a shadow tree stylesheet should cause an invalidation set update.")
+
+shouldBeDefined("window.internals");
+shouldBeDefined("window.eventSender");
+
+var red = "rgb(255, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+function hoverElement(element) {
+ eventSender.mouseMoveTo(0, 0);
+ document.body.offsetLeft; // force recalc.
+ var x = element.offsetLeft + 1;
+ var y = element.offsetTop + 1;
+ eventSender.mouseMoveTo(x, y);
+}
+
+// Add and remove a ":hover *" rule from a shadow tree.
+var root = host.createShadowRoot();
+root.innerHTML = "<style>:hover * { background-color: pink }</style>";
+hover.offsetTop;
+root.innerHTML = "";
+
+shouldBe("getComputedStyle(match).backgroundColor", "red");
+
+hoverElement(hover);
+
+shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+shouldBe("getComputedStyle(match).backgroundColor", "green");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/removed-hover-shadow-rule-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698