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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2911103002: Revert of Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Created 3 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/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index c0f23e6368c8bfc941385c5d7bddfc33a0323c16..2e8f1551f3b37d860ea623ce19ad56d6f56929de 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1180,21 +1180,6 @@
return GetFrame()->DevicePixelRatio();
}
-void LocalDOMWindow::scrollViewportTo(ScrollableArea* viewport,
- const ScrollOffset& offset,
- ScrollBehavior scroll_behavior) const {
- if (SmoothScrollSequencer* sequencer =
- GetFrame()->GetPage()->GetSmoothScrollSequencer()) {
- sequencer->AbortAnimations();
- if (scroll_behavior == kScrollBehaviorSmooth) {
- sequencer->QueueAnimation(viewport, offset);
- sequencer->RunQueuedAnimations();
- } else {
- viewport->SetScrollOffset(offset, kProgrammaticScroll, scroll_behavior);
- }
- }
-}
-
void LocalDOMWindow::scrollBy(double x,
double y,
ScrollBehavior scroll_behavior) const {
@@ -1222,7 +1207,8 @@
ScrollOffset scaled_delta(x * GetFrame()->PageZoomFactor(),
y * GetFrame()->PageZoomFactor());
- scrollViewportTo(viewport, current_offset + scaled_delta, scroll_behavior);
+ viewport->SetScrollOffset(current_offset + scaled_delta, kProgrammaticScroll,
+ scroll_behavior);
}
void LocalDOMWindow::scrollBy(const ScrollToOptions& scroll_to_options) const {
@@ -1263,7 +1249,8 @@
ScrollableArea* viewport = page->GetSettings().GetInertVisualViewport()
? view->LayoutViewportScrollableArea()
: view->GetScrollableArea();
- scrollViewportTo(viewport, layout_offset, kScrollBehaviorAuto);
+ viewport->SetScrollOffset(layout_offset, kProgrammaticScroll,
+ kScrollBehaviorAuto);
}
void LocalDOMWindow::scrollTo(const ScrollToOptions& scroll_to_options) const {
@@ -1310,7 +1297,8 @@
ScrollableArea::ScrollBehaviorFromString(scroll_to_options.behavior(),
scroll_behavior);
- scrollViewportTo(viewport, ScrollOffset(scaled_x, scaled_y), scroll_behavior);
+ viewport->SetScrollOffset(ScrollOffset(scaled_x, scaled_y),
+ kProgrammaticScroll, scroll_behavior);
}
void LocalDOMWindow::moveBy(int x, int y) const {
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.h ('k') | third_party/WebKit/Source/core/frame/LocalFrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698