Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / layout / display-none-no-relayout.html
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4     .a span {}
5 </style>
6 <div id="parent">
7     <span style="display:none"></span>
8     <div style="float:left;"></div>
9     <span></span>
10 </div>
11 <script>
12 // Force style recalc and layout.
13 document.body.offsetTop;
14
15 if (window.internals)
16     shouldBe("window.internals.needsLayoutCount()", "0", true);
17
18 var parent = document.getElementById("parent");
19
20 // Changing the class attribute here will cause a style recalc with a resulting
21 // reattach, but it should not cause a relayout.
22 parent.className = "a";
23
24 if (window.internals) {
25     shouldBe("window.internals.updateStyleAndReturnAffectedElementCount()", "3", true);
26     shouldBe("window.internals.needsLayoutCount()", "0", true);
27 }
28 </script>