Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/run-after-layout-and-paint.js"></script> | |
| 3 <script src="../../../resources/testharness.js"></script> | |
| 4 <script src="../../../resources/testharnessreport.js"></script> | |
| 5 <style> | |
| 6 body { height: 1000px } | |
| 7 div { height: 100px } | |
| 8 </style> | |
| 9 <div id="block1">abc</div> | |
| 10 <div id="block2">def</div> | |
| 11 <script> | |
| 12 // This test verifies that SANACLAP suppressions (http://bit.ly/sanaclap) | |
| 13 // apply to all layout passes in an animation frame, not just the one that | |
| 14 // sets the SANACLAP bit on the ScrollAnchor. | |
| 15 async_test((t) => { | |
| 16 scrollTo(0, 150); | |
| 17 runAfterLayoutAndPaint(() => { | |
| 18 // By itself this would trigger a scroll anchoring adjustment. | |
| 19 document.querySelector("#block1").style.height = "200px"; | |
| 20 | |
| 21 // Force synchronous layout. | |
| 22 document.body.offsetHeight; | |
|
ymalik
2016/10/13 13:05:39
Can we add a test that forces a call to Document::
skobes
2016/10/13 17:21:37
Done.
| |
| 23 | |
| 24 // Trigger SANACLAP suppression. | |
| 25 document.body.style.paddingTop = "20px"; | |
| 26 | |
| 27 runAfterLayoutAndPaint(() => { | |
| 28 assert_equals(scrollY, 150); | |
| 29 t.done(); | |
| 30 }); | |
| 31 }); | |
| 32 }, 'Suppressions apply to the entire frame.'); | |
| 33 </script> | |
| OLD | NEW |