| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 <div id="spanner"></div> | 3 <div id="spanner"></div> |
| 4 <script> | 4 <script> |
| 5 var styleCount, layoutCount; | 5 var styleCount, layoutCount; |
| 6 | 6 |
| 7 setPrintTestResultsLazily(); |
| 8 |
| 7 function assertSyncLayout(sync) { | 9 function assertSyncLayout(sync) { |
| 8 if (window.internals) { | 10 if (window.internals) { |
| 9 styleCount = internals.updateStyleAndReturnAffectedElementCount(); | 11 styleCount = internals.updateStyleAndReturnAffectedElementCount(); |
| 10 layoutCount = internals.needsLayoutCount(); | 12 layoutCount = internals.needsLayoutCount(); |
| 11 // scrollTo should have synchronously updated style and layout | 13 // scrollTo should have synchronously updated style and layout |
| 12 if (sync) { | 14 if (sync) { |
| 13 shouldBe("styleCount", "0"); | 15 shouldBe("styleCount", "0"); |
| 14 shouldBe("layoutCount", "0"); | 16 shouldBe("layoutCount", "0"); |
| 15 } else { | 17 } else { |
| 16 shouldNotBe("styleCount", "0"); | 18 shouldNotBe("styleCount", "0"); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 39 assertSyncLayout(true); | 41 assertSyncLayout(true); |
| 40 | 42 |
| 41 spanner.style.height = "2px"; | 43 spanner.style.height = "2px"; |
| 42 scrollTo({ top: 0 }); | 44 scrollTo({ top: 0 }); |
| 43 assertSyncLayout(true); | 45 assertSyncLayout(true); |
| 44 | 46 |
| 45 spanner.style.height = "3px"; | 47 spanner.style.height = "3px"; |
| 46 scrollTo({ }); | 48 scrollTo({ }); |
| 47 assertSyncLayout(true); | 49 assertSyncLayout(true); |
| 48 </script> | 50 </script> |
| OLD | NEW |