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

Side by Side Diff: LayoutTests/fast/layout/common-ancestor-relayout-boundary.html

Issue 140763007: Begin removing the style recalc timer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test results Created 6 years, 11 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 | Annotate | Revision Log
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 /* Make all divs relayout boundaries. */ 4 /* Make all divs relayout boundaries. */
5 div { 5 div {
6 width: 100px; 6 width: 100px;
7 height: 100px; 7 height: 100px;
8 overflow: hidden; 8 overflow: hidden;
9 } 9 }
10 </style> 10 </style>
11 <div id="relayout-common-ancestor"><div><div></div></div><div><div></div></div>< /div> 11 <div id="relayout-common-ancestor"><div><div></div></div><div><div></div></div>< /div>
12 <script> 12 <script>
13 function dirtyLayout() 13 function dirtyLayout()
14 { 14 {
15 var container = document.getElementById('relayout-common-ancestor'); 15 var container = document.getElementById('relayout-common-ancestor');
16 for (var i = 0; i < container.childNodes.length; ++i) { 16 for (var i = 0; i < container.childNodes.length; ++i) {
17 var child = container.childNodes[i].firstChild; 17 var child = container.childNodes[i].firstChild;
18 child.style.width = "99px"; 18 child.style.width = "99px";
19 // Force a style recalc that doesn't force a layout so that the 19 // Force a style recalc that doesn't force a layout so that the
20 // needsLayout count is incremented. 20 // needsLayout count is incremented.
21 getComputedStyle(child).color; 21 getComputedStyle(child).color;
22 } 22 }
23 } 23 }
24 24
25 if (window.internals)
26 shouldBe("window.internals.needsLayoutCount()", "2");
27
28 document.documentElement.offsetTop; 25 document.documentElement.offsetTop;
29 26
30 // Pass quiet=true here so that the added nodes from the shouldBe don't 27 // Pass quiet=true here so that the added nodes from the shouldBe don't
31 // mess up the needsLayoutCount on line 45. 28 // mess up the needsLayoutCount on line 45.
32 if (window.internals) 29 if (window.internals)
33 shouldBe("window.internals.needsLayoutCount()", "0", true); 30 shouldBe("window.internals.needsLayoutCount()", "0", true);
34 31
35 dirtyLayout(); 32 dirtyLayout();
36 33
37 // FIXME: In theory we can restrict the layoutRoot in FrameView to the common 34 // FIXME: In theory we can restrict the layoutRoot in FrameView to the common
38 // ancestor container and this should only be 5 instead of 8. 35 // ancestor container and this should only be 5 instead of 8.
39 if (window.internals) 36 if (window.internals)
40 shouldBe("window.internals.needsLayoutCount()", "8"); 37 shouldBe("window.internals.needsLayoutCount()", "8");
41 38
42 document.documentElement.offsetTop; 39 document.documentElement.offsetTop;
43 40
44 if (window.internals) 41 if (window.internals)
45 shouldBe("window.internals.needsLayoutCount()", "0"); 42 shouldBe("window.internals.needsLayoutCount()", "0");
46 </script> 43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698