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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-recalc.html

Issue 1896793002: Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 .a + .b { color: green; } 4 .a + .b { color: green; }
5 .c + .d { color: green; } 5 .c + .d { color: green; }
6 .e { color: green; } 6 .e { color: green; }
7 </style> 7 </style>
8 <div id="t1"> 8 <div id="t1">
9 <div></div> 9 <div></div>
10 <div class="b"></div> 10 <div class="b"></div>
(...skipping 21 matching lines...) Expand all
32 description("Check that getComputedStyle causes a style recalc when necessary, a nd only when necessary."); 32 description("Check that getComputedStyle causes a style recalc when necessary, a nd only when necessary.");
33 33
34 var green = "rgb(0, 128, 0)"; 34 var green = "rgb(0, 128, 0)";
35 35
36 // Check that sibling recalc for .b is performed before computed style is return ed. 36 // Check that sibling recalc for .b is performed before computed style is return ed.
37 37
38 document.body.offsetTop; 38 document.body.offsetTop;
39 document.body.querySelector("#t1 > div").className = "a"; 39 document.body.querySelector("#t1 > div").className = "a";
40 shouldBe("getComputedStyle(document.body.querySelector('#t1 .b')).color", "green ", true); 40 shouldBe("getComputedStyle(document.body.querySelector('#t1 .b')).color", "green ", true);
41 if (window.internals) 41 if (window.internals)
42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0"); 42 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "0 ");
43 43
44 // No style invalidation or recalc scheduled for an ascendant of .e, and no affe cted-by-adjacent 44 // No style invalidation or recalc scheduled for an ascendant of .e, and no affe cted-by-adjacent
45 // bits set on any ascendants, hence we don't need to do a recalc even if a styl e invalidation 45 // bits set on any ascendants, hence we don't need to do a recalc even if a styl e invalidation
46 // is scheduled for the .c change with adjacent implications. 46 // is scheduled for the .c change with adjacent implications.
47 47
48 document.body.offsetTop; 48 document.body.offsetTop;
49 document.body.querySelector("#t2 > div > div").className = "c"; 49 document.body.querySelector("#t2 > div > div").className = "c";
50 shouldBe("getComputedStyle(document.body.querySelector('#t2 .e')).color", "green ", true); 50 shouldBe("getComputedStyle(document.body.querySelector('#t2 .e')).color", "green ", true);
51 if (window.internals) 51 if (window.internals)
52 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); 52 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "1 ");
53 53
54 // No style invalidation or recalc scheduled for an ascendant of .b, and even if affected-by-adjacent 54 // No style invalidation or recalc scheduled for an ascendant of .b, and even if affected-by-adjacent
55 // bits are set on the ascendant (because of a+b), it doesn't matter since that ascendant does 55 // bits are set on the ascendant (because of a+b), it doesn't matter since that ascendant does
56 // not have any children that needs style recalc or invalidation. 56 // not have any children that needs style recalc or invalidation.
57 57
58 document.body.offsetTop; 58 document.body.offsetTop;
59 document.body.querySelector("#t3 > div > div").className = "c"; 59 document.body.querySelector("#t3 > div > div").className = "c";
60 shouldBe("getComputedStyle(document.body.querySelector('#t3 .b')).color", "green ", true); 60 shouldBe("getComputedStyle(document.body.querySelector('#t3 .b')).color", "green ", true);
61 if (window.internals) 61 if (window.internals)
62 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); 62 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "1 ");
63 63
64 </script> 64 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698