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

Unified Diff: third_party/WebKit/Source/core/frame/DOMVisualViewport.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/core/frame/DOMVisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp b/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
index 1fe1865fb62dc6334f85953200ad34d8ac459027..2e6ccba0270b3e88420e1c89819ea7bf76233bb6 100644
--- a/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
@@ -55,7 +55,7 @@ ExecutionContext* DOMVisualViewport::getExecutionContext() const {
return m_window->getExecutionContext();
}
-double DOMVisualViewport::scrollLeft() {
+float DOMVisualViewport::scrollLeft() {
LocalFrame* frame = m_window->frame();
if (!frame || !frame->isMainFrame())
return 0;
@@ -66,7 +66,7 @@ double DOMVisualViewport::scrollLeft() {
return 0;
}
-double DOMVisualViewport::scrollTop() {
+float DOMVisualViewport::scrollTop() {
LocalFrame* frame = m_window->frame();
if (!frame || !frame->isMainFrame())
return 0;
@@ -77,7 +77,7 @@ double DOMVisualViewport::scrollTop() {
return 0;
}
-double DOMVisualViewport::pageX() {
+float DOMVisualViewport::pageX() {
LocalFrame* frame = m_window->frame();
if (!frame)
return 0;
@@ -87,11 +87,11 @@ double DOMVisualViewport::pageX() {
return 0;
frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
- double viewportX = view->getScrollableArea()->scrollPositionDouble().x();
+ float viewportX = view->getScrollableArea()->scrollOffset().width();
return adjustScrollForAbsoluteZoom(viewportX, frame->pageZoomFactor());
}
-double DOMVisualViewport::pageY() {
+float DOMVisualViewport::pageY() {
LocalFrame* frame = m_window->frame();
if (!frame)
return 0;
@@ -101,7 +101,7 @@ double DOMVisualViewport::pageY() {
return 0;
frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
- double viewportY = view->getScrollableArea()->scrollPositionDouble().y();
+ float viewportY = view->getScrollableArea()->scrollOffset().height();
return adjustScrollForAbsoluteZoom(viewportY, frame->pageZoomFactor());
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMVisualViewport.h ('k') | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698