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