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

Side by Side Diff: LayoutTests/fast/css/invalidation/empty-pseudo-sibling.html

Issue 565493002: Use invalidation set for :empty pseudo changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@empty-flag-20140910
Patch Set: Created 6 years, 3 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 :empty + div { background-color: green }
5 </style>
6 <div id="empty"></div>
7 <div id="emptySibling">
8 <div></div>
9 <div></div>
10 <div></div>
11 <div></div>
12 </div>
13 <div id="notEmpty"><div id="child"></div></div>
14 <div id="notEmptySibling">
15 <div></div>
16 <div></div>
17 <div></div>
18 <div></div>
19 </div>
20 <script>
21 description("Use descendant invalidation set for :empty pseudo class - sibling i nvalidation.")
22
23 var transparent = "rgba(0, 0, 0, 0)";
24 var green = "rgb(0, 128, 0)";
25
26 shouldBe("getComputedStyle(emptySibling, '').backgroundColor", "green");
27
28 empty.offsetTop; // force recalc
29 empty.appendChild(document.createElement("div"));
30
31 if (window.internals)
32 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "7");
33
34 shouldBe("getComputedStyle(emptySibling, '').backgroundColor", "transparent");
35
36 shouldBe("getComputedStyle(notEmptySibling, '').backgroundColor", "transparent") ;
37
38 notEmpty.offsetTop; // force recalc
39 notEmpty.removeChild(child);
40
41 if (window.internals)
42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
43
44 shouldBe("getComputedStyle(notEmptySibling, '').backgroundColor", "green");
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698