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

Unified Diff: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/feedback-loop.html

Issue 2250523003: Implement SANACLAP (http://bit.ly/sanaclap). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comment Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/feedback-loop.html
diff --git a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/feedback-loop.html b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/feedback-loop.html
deleted file mode 100644
index 2bfe126d2c264769398928f19f913f217f593c61..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/feedback-loop.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html>
-<script src="../../../resources/testharness.js"></script>
-<script src="../../../resources/testharnessreport.js"></script>
-<style>
-
-body { margin: 0; height: 5000px; }
-#evil { height: 200px; width: 200px; background-color: #fcc; }
-
-</style>
-<div id="evil"></div>
-<script>
-
-internals.runtimeFlags.scrollAnchoringEnabled = true;
-
-var kMaxAdjustments = 20; // Keep in sync with kMaxAdjustments in ScrollAnchor.cpp
-
-var evil = document.querySelector('#evil');
-onscroll = () => { evil.style.marginTop = scrollY + "px"; };
-
-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() {
- var y = 10;
- return Promise.resolve()
- .then(() => { scrollTo(0, y); })
- .then(() => scrollSettlesAt(y + kMaxAdjustments * y));
-}, "Scroll anchoring with scroll event handler feedback loop");
-
-</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/onscroll-bouncing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698