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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Build fix Created 5 years, 6 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 | « Source/core/frame/FrameView.h ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 94d913e3b646f7a8378be4998521cc41f1e66b48..d2f308350872ea4aa90113b78f477a5a2a38fa3b 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1486,7 +1486,7 @@ void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode)
scrollToAnchor();
}
-void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollBehavior scrollBehavior)
+void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollType scrollType, ScrollBehavior scrollBehavior)
{
cancelProgrammaticScrollAnimation();
m_maintainScrollPositionAnchor = nullptr;
@@ -1500,9 +1500,11 @@ void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollBehavior
if (scrollBehavior == ScrollBehaviorInstant) {
DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y());
+ // TODO(bokan): Why do we need to go through updateScrollbars? If not, we can
+ // just delete this whole method and use the base version.
updateScrollbars(newOffset);
} else {
- programmaticallyScrollSmoothlyToOffset(toFloatPoint(newScrollPosition));
+ ScrollableArea::setScrollPosition(newScrollPosition, ProgrammaticScroll, ScrollBehaviorSmooth);
}
}
@@ -3200,12 +3202,12 @@ int FrameView::scrollSize(ScrollbarOrientation orientation) const
return scrollbar->totalSize() - scrollbar->visibleSize();
}
-void FrameView::setScrollOffset(const IntPoint& offset)
+void FrameView::setScrollOffset(const IntPoint& offset, ScrollType)
{
scrollTo(DoublePoint(adjustScrollPositionWithinRange(offset)));
}
-void FrameView::setScrollOffset(const DoublePoint& offset)
+void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType)
{
scrollTo(adjustScrollPositionWithinRange(offset));
}
@@ -3447,7 +3449,7 @@ void FrameView::setScrollOffsetFromUpdateScrollbars(const DoubleSize& offset)
adjustedScrollPosition = adjustScrollPositionWithinRange(adjustedScrollPosition);
if (adjustedScrollPosition != scrollPositionDouble() || scrollOriginChanged()) {
- ScrollableArea::scrollToOffsetWithoutAnimation(toFloatPoint(adjustedScrollPosition));
+ ScrollableArea::setScrollPosition(adjustedScrollPosition, ProgrammaticScroll);
resetScrollOriginChanged();
}
}
@@ -3733,7 +3735,7 @@ LayoutRect FrameView::scrollIntoView(const LayoutRect& rectInContent, const Scro
double xOffset = exposeRect.x();
double yOffset = exposeRect.y();
- setScrollPosition(DoublePoint(xOffset, yOffset));
+ setScrollPosition(DoublePoint(xOffset, yOffset), ProgrammaticScroll);
// Scrolling the FrameView cannot change the input rect's location relative to the document.
return rectInContent;
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698