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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 #match { background-color: red }
5 #hover:hover #match { background-color: green }
6 </style>
7 <div id="hover">
8 Hover this text ...
9 <span></span>
10 <span></span>
11 <span></span>
12 <span></span>
13 <span id="match"> and this should have a green background.</span>
14 </div>
15 <div id="host"></div>
16 <script>
17 description("Removing a shadow tree stylesheet should cause an invalidation set update.")
18
19 shouldBeDefined("window.internals");
20 shouldBeDefined("window.eventSender");
21
22 var red = "rgb(255, 0, 0)";
23 var green = "rgb(0, 128, 0)";
24
25 function hoverElement(element) {
26 eventSender.mouseMoveTo(0, 0);
27 document.body.offsetLeft; // force recalc.
28 var x = element.offsetLeft + 1;
29 var y = element.offsetTop + 1;
30 eventSender.mouseMoveTo(x, y);
31 }
32
33 // Add and remove a ":hover *" rule from a shadow tree.
34 var root = host.createShadowRoot();
35 root.innerHTML = "<style>:hover * { background-color: pink }</style>";
36 hover.offsetTop;
37 root.innerHTML = "";
38
39 shouldBe("getComputedStyle(match).backgroundColor", "red");
40
41 hoverElement(hover);
42
43 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
44 shouldBe("getComputedStyle(match).backgroundColor", "green");
45
46 </script>
OLDNEW
« 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