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

Unified Diff: LayoutTests/fast/dynamic/hover-sibling-reattach.html

Issue 304183009: Reset RestyleFlags when Element is removed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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: LayoutTests/fast/dynamic/hover-sibling-reattach.html
diff --git a/LayoutTests/fast/dynamic/hover-sibling-reattach.html b/LayoutTests/fast/dynamic/hover-sibling-reattach.html
new file mode 100644
index 0000000000000000000000000000000000000000..5b15f9a98f1beca48aa0b05a146ad301d3e59257
--- /dev/null
+++ b/LayoutTests/fast/dynamic/hover-sibling-reattach.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style>
+#outer {
+ position: absolute;
+ left: 0;
+ top: 0
+}
+
+#outer div {
+ width: 100px;
+ height: 100px
+}
+
+#hover:hover + #test {
+ background-color: black
+}
+</style>
+<div id="outer">
+ <div id="hover"></div>
+ <div id="test"></div>
+</div>
+<script>
+description("Check that childrenAffectedByHover is intact after a re-attach.");
+
+function mouseOver(x, y) {
+ if (window.eventSender)
+ eventSender.mouseMoveTo(x, y);
+ document.body.offsetTop; // force style recalc
+}
+
+var black = "rgb(0, 0, 0)";
+var transparent = "rgba(0, 0, 0, 0)";
+
+var test = document.getElementById('test');
+
+shouldBe("getComputedStyle(test, '').backgroundColor", "transparent");
+
+// Hover #hover
+mouseOver(50, 50);
+shouldBe("getComputedStyle(test, '').backgroundColor", "black");
+
+// Hover body
+mouseOver(0, 200);
+shouldBe("getComputedStyle(test, '').backgroundColor", "transparent");
+
+// Force re-attach
+document.getElementById("hover").style.display = "inline-block";
+
+// Hover #hover
+mouseOver(50, 50);
+shouldBe("getComputedStyle(test, '').backgroundColor", "black");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dynamic/hover-sibling-reattach-expected.txt » ('j') | Source/core/dom/Element.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698