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

Unified Diff: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html

Issue 2002623003: Exclude position:absolute elements when picking an anchor for ScrollAnchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/onscroll-bouncing.html
diff --git a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html
index 902b7cdeed2fc06a438fca783d8d0dcc8984ae29..8e9fc280c1f193edb8863d962bfb27995956b6a9 100644
--- a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html
+++ b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
+<script src="resources/scroll-anchoring-test.js"></script>
<style>
body { margin: 80px 0; height: 5000px; }
@@ -53,32 +54,6 @@ onscroll = function() {
a.className = (fixed = !fixed) ? "f" : "";
};
-var frame = () => new Promise((resolve) => { requestAnimationFrame(resolve); });
-
-var waitFor = function(condition, failmsg, deadline) {
- if (!deadline) deadline = Date.now() + 1000;
- if (condition()) return Promise.resolve();
- else if (Date.now() > deadline) return Promise.reject(failmsg);
- else return frame().then(() => waitFor(condition, failmsg, deadline));
-};
-
-var waitFrames = function(n, condition, failmsg) {
- var p = Promise.resolve();
- var check = () => (!condition || condition() ?
- Promise.resolve() : Promise.reject(failmsg));
- while (n--)
- p = p.then(check).then(frame);
- return p.then(check);
-};
-
-var scrollSettlesAt = function(expectedY) {
- return waitFor(() => (scrollY == expectedY),
- "scroll did not reach " + expectedY)
- .then(() => waitFrames(3))
- .then(() => waitFrames(3, () => (scrollY == expectedY),
- "scroll did not stay at " + expectedY));
-};
-
promise_test(function() {
return Promise.resolve()

Powered by Google App Engine
This is Rietveld 408576698