blob: eb6964e5565ef07d370509c867fe6bf76d83637a [file] [log] [blame]
<!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>