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

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: address comments 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
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 45e333d40163e98382cb41ec151153ddfe6c8ff5..ee11bf2257a334fc2c9303f51e5788a26657602b 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1411,7 +1411,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());
@@ -1419,15 +1419,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) {
@@ -2124,7 +2124,7 @@ void FrameView::setVisibleContentScaleFactor(float visibleContentScaleFactor)
return;
m_visibleContentScaleFactor = visibleContentScaleFactor;
- updateScrollbars(scrollOffset());
+ updateScrollbars(scrollOffsetDouble());
}
void FrameView::setInputEventsTransformForEmulation(const IntSize& offset, float contentScaleFactor)

Powered by Google App Engine
This is Rietveld 408576698