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

Unified Diff: third_party/WebKit/Source/web/RotationViewportAnchor.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 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: third_party/WebKit/Source/web/RotationViewportAnchor.cpp
diff --git a/third_party/WebKit/Source/web/RotationViewportAnchor.cpp b/third_party/WebKit/Source/web/RotationViewportAnchor.cpp
index 3bdcf008a9d7c2adb38c7e343731d515069e3472..b8532dd15215c130acfff440baef1077adb16b43 100644
--- a/third_party/WebKit/Source/web/RotationViewportAnchor.cpp
+++ b/third_party/WebKit/Source/web/RotationViewportAnchor.cpp
@@ -107,8 +107,7 @@ void RotationViewportAnchor::setAnchor() {
IntRect outerViewRect =
layoutViewport().visibleContentRect(IncludeScrollbars);
- IntRect innerViewRect =
- enclosedIntRect(rootFrameViewport->visibleContentRectDouble());
+ IntRect innerViewRect = rootFrameViewport->visibleContentRect();
m_oldPageScaleFactor = m_visualViewport->scale();
m_oldMinimumPageScaleFactor =
@@ -117,7 +116,7 @@ void RotationViewportAnchor::setAnchor() {
// Save the absolute location in case we won't find the anchor node, we'll
// fall back to that.
m_visualViewportInDocument =
- FloatPoint(rootFrameViewport->visibleContentRectDouble().location());
+ FloatPoint(rootFrameViewport->visibleContentRect().location());
m_anchorNode.clear();
m_anchorNodeBounds = LayoutRect();
@@ -181,7 +180,8 @@ void RotationViewportAnchor::restoreToAnchor() {
computeOrigins(visualViewportSize, mainFrameOrigin, visualViewportOrigin);
- layoutViewport().setScrollPosition(mainFrameOrigin, ProgrammaticScroll);
+ layoutViewport().setScrollOffset(toScrollOffset(mainFrameOrigin),
+ ProgrammaticScroll);
// Set scale before location, since location can be clamped on setting scale.
m_visualViewport->setScale(newPageScaleFactor);
@@ -213,8 +213,8 @@ void RotationViewportAnchor::computeOrigins(
moveToEncloseRect(outerRect, innerRect);
- outerRect.setLocation(
- layoutViewport().clampScrollPosition(outerRect.location()));
+ outerRect.setLocation(IntPoint(
+ layoutViewport().clampScrollOffset(toIntSize(outerRect.location()))));
moveIntoRect(innerRect, outerRect);
« no previous file with comments | « third_party/WebKit/Source/web/ResizeViewportAnchor.cpp ('k') | third_party/WebKit/Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698