Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/suppressions-are-per-frame.html

Issue 2404393003: Tie scroll anchoring adjustments to frame lifecycle instead of layout. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.h » ('j') | third_party/WebKit/Source/core/layout/ScrollAnchor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698