| <!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("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("internals.updateStyleAndReturnAffectedElementCount()", "2", true); |
| shouldBe("internals.needsLayoutCount()", "0", true); |
| } |
| </script> |