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

Unified Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js

Issue 2511473003: Round the scroll offset synced back to main instead of flooring. (Closed)
Patch Set: Wait for scroll animation to complete before checking main thread scrolling reasons. Created 4 years, 1 month 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/scroll-behavior/resources/scroll-interruption-test.js
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js b/third_party/WebKit/LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js
index 26bc88f291fecd3c783d4331edffc92d5e80d894..94a75672b7609513a33c0308fd75673494b8c44a 100644
--- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js
+++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js
@@ -47,7 +47,21 @@ SmoothScrollInterruptionTest.prototype.startNextTestCase = function() {
var scrollStartPoint = this.scrollStartPoint;
scrollElement.scrollTop = scrollStartPoint;
- window.requestAnimationFrame(this.performSmoothScroll.bind(this));
+ window.requestAnimationFrame(this.waitForSyncScroll.bind(this));
+}
+
+SmoothScrollInterruptionTest.prototype.waitForSyncScroll = function() {
+ // Wait until cc has received the commit from main with the scrollStartPoint.
+ if (this.scrollElement.scrollTop != this.scrollStartPoint) {
+ // TODO(flackr): There seems to be a bug in that we shouldn't have to
+ // reapply the scroll position when cancelling a smooth scroll.
+ // https://crbug.com/667477
+ this.scrollElement.scrollTop = this.scrollStartPoint;
+ window.requestAnimationFrame(this.waitForSyncScroll.bind(this));
+ return;
+ }
+
+ this.performSmoothScroll();
}
SmoothScrollInterruptionTest.prototype.performSmoothScroll = function() {

Powered by Google App Engine
This is Rietveld 408576698