Index: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/suppressions-are-per-frame.html |
diff --git a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/suppressions-are-per-frame.html b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/suppressions-are-per-frame.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e67bb4be407c662e8113c049a04b5c81f9744770 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/suppressions-are-per-frame.html |
@@ -0,0 +1,33 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/run-after-layout-and-paint.js"></script> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<style> |
+body { height: 1000px } |
+div { height: 100px } |
+</style> |
+<div id="block1">abc</div> |
+<div id="block2">def</div> |
+<script> |
+ // This test verifies that SANACLAP suppressions (http://bit.ly/sanaclap) |
+ // apply to all layout passes in an animation frame, not just the one that |
+ // sets the SANACLAP bit on the ScrollAnchor. |
+ async_test((t) => { |
+ scrollTo(0, 150); |
+ runAfterLayoutAndPaint(() => { |
+ // By itself this would trigger a scroll anchoring adjustment. |
+ document.querySelector("#block1").style.height = "200px"; |
+ |
+ // Force synchronous layout. |
+ 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.
|
+ |
+ // Trigger SANACLAP suppression. |
+ document.body.style.paddingTop = "20px"; |
+ |
+ runAfterLayoutAndPaint(() => { |
+ assert_equals(scrollY, 150); |
+ t.done(); |
+ }); |
+ }); |
+ }, 'Suppressions apply to the entire frame.'); |
+</script> |