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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: 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 11c0c801fdd6bd7da035a40a7ec70ca5fb1d55b1..c161f6bb39fb3731ddc98e5e5f9b12b9a6f80adc 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 =
@@ -116,7 +115,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();
@@ -180,7 +179,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);
@@ -212,8 +212,8 @@ void RotationViewportAnchor::computeOrigins(
moveToEncloseRect(outerRect, innerRect);
- outerRect.setLocation(
- layoutViewport().clampScrollPosition(outerRect.location()));
+ outerRect.setLocation(IntPoint(
+ layoutViewport().clampScrollOffset(toIntSize(outerRect.location()))));
moveIntoRect(innerRect, outerRect);

Powered by Google App Engine
This is Rietveld 408576698