| Index: third_party/WebKit/Source/core/frame/FrameView.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| index 492fabdffb528c5f48f0bcd315d3d5ef9b7dddf4..154222c1b9052cdbf44cae7300ba869ed29b6010 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -2053,6 +2053,14 @@ HostWindow* FrameView::getHostWindow() const {
|
| return &page->chromeClient();
|
| }
|
|
|
| +ProgrammaticScrollCoordinator* FrameView::getProgrammaticScrollCoordinator()
|
| + const {
|
| + Page* page = frame().page();
|
| + if (!page)
|
| + return nullptr;
|
| + return page->scrollingCoordinator()->programmaticScrollCoordinator();
|
| +}
|
| +
|
| void FrameView::contentsResized() {
|
| if (m_frame->isMainFrame() && m_frame->document()) {
|
| if (TextAutosizer* textAutosizer = m_frame->document()->textAutosizer())
|
| @@ -4378,16 +4386,23 @@ Widget* FrameView::getWidget() {
|
| LayoutRect FrameView::scrollIntoView(const LayoutRect& rectInContent,
|
| const ScrollAlignment& alignX,
|
| const ScrollAlignment& alignY,
|
| - ScrollType scrollType) {
|
| + ScrollType scrollType,
|
| + ScrollBehavior scrollBehavior) {
|
| LayoutRect viewRect(visibleContentRect());
|
| LayoutRect exposeRect =
|
| ScrollAlignment::getRectToExpose(viewRect, rectInContent, alignX, alignY);
|
| if (exposeRect != viewRect) {
|
| - setScrollOffset(
|
| - ScrollOffset(exposeRect.x().toFloat(), exposeRect.y().toFloat()),
|
| - scrollType);
|
| + if (scrollBehavior == ScrollBehaviorSmooth) {
|
| + DCHECK(scrollType != UserScroll);
|
| + getProgrammaticScrollCoordinator()->queueAnimation(
|
| + this,
|
| + ScrollOffset(exposeRect.x().toFloat(), exposeRect.y().toFloat()));
|
| + } else {
|
| + setScrollOffset(
|
| + ScrollOffset(exposeRect.x().toFloat(), exposeRect.y().toFloat()),
|
| + scrollType);
|
| + }
|
| }
|
| -
|
| // Scrolling the FrameView cannot change the input rect's location relative to
|
| // the document.
|
| return rectInContent;
|
|
|