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

Side by Side Diff: LayoutTests/fast/css/dynamic-class-pseudo-elements.html

Issue 1349543004: CSS: Avoid invalidating style when only descendants need updating (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: invalidatesSelf Created 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script> 2 <script src="../../resources/js-test.js"></script>
3 <style> 3 <style>
4 .a1 .b1::before { background-color: green; content: "X" } 4 .a1 .b1::before { background-color: green; content: "X" }
5 .a2 .b2::after { background-color: green; content: "X" } 5 .a2 .b2::after { background-color: green; content: "X" }
6 .a3 .b3::first-line { background-color: green } 6 .a3 .b3::first-line { background-color: green }
7 .a4 .b4::first-letter { background-color: green } 7 .a4 .b4::first-letter { background-color: green }
8 8
9 /* workaround for issue 351322 */ 9 /* workaround for issue 351322 */
10 .b3::first-line { background-color: transparent } 10 .b3::first-line { background-color: transparent }
(...skipping 27 matching lines...) Expand all
38 var green = 'rgb(0, 128, 0)'; 38 var green = 'rgb(0, 128, 0)';
39 39
40 var t1 = document.getElementById("t1"); 40 var t1 = document.getElementById("t1");
41 var r1 = document.getElementById("r1"); 41 var r1 = document.getElementById("r1");
42 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "transparent"); 42 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "transparent");
43 43
44 forceLayout(); 44 forceLayout();
45 t1.className = "a1"; 45 t1.className = "a1";
46 46
47 if (window.internals) 47 if (window.internals)
48 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); 48 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
49 49
50 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "green"); 50 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "green");
51 51
52 var t2 = document.getElementById("t2"); 52 var t2 = document.getElementById("t2");
53 var r2 = document.getElementById("r2"); 53 var r2 = document.getElementById("r2");
54 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "transparent"); 54 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "transparent");
55 55
56 forceLayout(); 56 forceLayout();
57 t2.className = "a2"; 57 t2.className = "a2";
58 58
59 if (window.internals) 59 if (window.internals)
60 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); 60 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
61 61
62 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "green"); 62 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "green");
63 63
64 var t3 = document.getElementById("t3"); 64 var t3 = document.getElementById("t3");
65 var r3 = document.getElementById("r3"); 65 var r3 = document.getElementById("r3");
66 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "transparent"); 66 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "transparent");
67 67
68 forceLayout(); 68 forceLayout();
69 t3.className = "a3"; 69 t3.className = "a3";
70 70
71 if (window.internals) 71 if (window.internals)
72 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "9"); 72 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "9");
73 73
74 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "green"); 74 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "green");
75 75
76 var t4 = document.getElementById("t4"); 76 var t4 = document.getElementById("t4");
77 var r4 = document.getElementById("r4"); 77 var r4 = document.getElementById("r4");
78 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "transparent" ); 78 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "transparent" );
79 79
80 forceLayout(); 80 forceLayout();
81 t4.className = "a4"; 81 t4.className = "a4";
82 82
83 if (window.internals) 83 if (window.internals)
84 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "10"); 84 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "10");
85 85
86 document.body.offsetLeft; // workaround for issue 351308 86 document.body.offsetLeft; // workaround for issue 351308
87 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "green"); 87 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "green");
88 </script> 88 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698