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

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

Issue 610423004: Preserve fractional scroll offset for JS scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 2 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 5d9c2a7e320c6c32aa0f385cad0a0c324d7e7750..f9b2addfb36e4f5fa2fd978be59dd2efcc965f1a 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1412,7 +1412,7 @@ void FrameView::scrollElementToRect(Element* element, const IntRect& rect)
bounds.x() - centeringOffsetX - targetRect.x(),
bounds.y() - centeringOffsetY - targetRect.y());
- setScrollPosition(targetOffset);
+ setScrollPosition(DoublePoint(targetOffset));
if (pinchVirtualViewportEnabled) {
IntPoint remainder = IntPoint(targetOffset - scrollPosition());
@@ -1420,15 +1420,15 @@ void FrameView::scrollElementToRect(Element* element, const IntRect& rect)
}
}
-void FrameView::setScrollPosition(const IntPoint& scrollPoint, ScrollBehavior scrollBehavior)
+void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollBehavior scrollBehavior)
{
cancelProgrammaticScrollAnimation();
TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
m_maintainScrollPositionAnchor = nullptr;
- IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
+ DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
- if (newScrollPosition == scrollPosition())
+ if (newScrollPosition == scrollPositionDouble())
return;
if (scrollBehavior == ScrollBehaviorAuto) {
@@ -2130,7 +2130,7 @@ void FrameView::setVisibleContentScaleFactor(float visibleContentScaleFactor)
return;
m_visibleContentScaleFactor = visibleContentScaleFactor;
- updateScrollbars(scrollOffset());
+ updateScrollbars(scrollOffsetDouble());
}
void FrameView::setInputEventsTransformForEmulation(const IntSize& offset, float contentScaleFactor)
« 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