2 <script src=
"../../resources/js-test.js"></script>
4 /* Make all divs relayout boundaries. */
11 <div id=
"relayout-common-ancestor"><div><div></div></div><div><div></div></div></div>
13 function dirtyLayout()
15 var container
= document
.getElementById('relayout-common-ancestor');
16 for (var i
= 0; i
< container
.childNodes
.length
; ++i
) {
17 var child
= container
.childNodes
[i
].firstChild
;
18 child
.style
.width
= "99px";
19 // Force a style recalc that doesn't force a layout so that the
20 // needsLayout count is incremented.
21 getComputedStyle(child
).color
;
25 document
.documentElement
.offsetTop
;
27 // Pass quiet=true here so that the added nodes from the shouldBe don't
28 // mess up the needsLayoutCount on line 45.
30 shouldBe("window.internals.needsLayoutCount()", "0", true);
34 // The tree appears as following, with the starred nodes dirty:
35 // div [relayout-common-ancestor]
41 shouldBe("window.internals.needsLayoutCount()", "4");
43 document
.documentElement
.offsetTop
;
46 shouldBe("window.internals.needsLayoutCount()", "0");