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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2650343008: Implement Element.scrollIntoView for scroll-behavior: smooth. (Closed)
Patch Set: Add a short comment. 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/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index 769acc39df44b05836e2d8ab1259afcd765a904f..09a44edf3f6e81b0f9ebe032ce4082a293c82170 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -37,6 +37,7 @@
#include "platform/scroll/MainThreadScrollingReason.h"
#include "platform/scroll/ProgrammaticScrollAnimator.h"
#include "platform/scroll/ScrollbarTheme.h"
+#include "platform/scroll/SmoothScrollSequencer.h"
static const int kPixelsPerLineStep = 40;
static const float kMinFractionToStepWhenPaging = 0.875f;
@@ -227,7 +228,7 @@ void ScrollableArea::ProgrammaticScrollHelper(const ScrollOffset& offset,
CancelScrollAnimation();
if (scroll_behavior == kScrollBehaviorSmooth)
- GetProgrammaticScrollAnimator().AnimateToOffset(offset);
+ GetProgrammaticScrollAnimator().AnimateToOffset(offset, true);
else
GetProgrammaticScrollAnimator().ScrollToOffsetWithoutAnimation(offset);
}
@@ -255,6 +256,7 @@ void ScrollableArea::UserScrollHelper(const ScrollOffset& offset,
LayoutRect ScrollableArea::ScrollIntoView(const LayoutRect& rect_in_content,
const ScrollAlignment& align_x,
const ScrollAlignment& align_y,
+ bool is_smooth,
ScrollType) {
// TODO(bokan): This should really be implemented here but ScrollAlignment is
// in Core which is a dependency violation.

Powered by Google App Engine
This is Rietveld 408576698