summaryrefslogtreecommitdiffstats
path: root/WebCore/page
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-05-26 12:27:41 -0700
committerGrace Kloba <klobag@google.com>2010-05-27 11:19:34 -0700
commita551d0e188b3b4a05e05cc70ff0838c3165c10f6 (patch)
tree2beaf6e70229eae75bbd9f467d7f9727aadcb807 /WebCore/page
parent619aaff8ae3a2b4614393bac582ef28cf2d7939b (diff)
downloadexternal_webkit-a551d0e188b3b4a05e05cc70ff0838c3165c10f6.zip
external_webkit-a551d0e188b3b4a05e05cc70ff0838c3165c10f6.tar.gz
external_webkit-a551d0e188b3b4a05e05cc70ff0838c3165c10f6.tar.bz2
Report correct window.innerWidth and window.innerHeight.
I agree with this article that we should have a way to report the visible viewport to the JavaScript. http://www.quirksmode.org/mobile/viewports2.html#link6 Fix http://b/issue?id=2717861 I will try to upstream the code to WebKit separately.
Diffstat (limited to 'WebCore/page')
-rw-r--r--WebCore/page/DOMWindow.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 633feb6..a564cf4 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -954,7 +954,11 @@ int DOMWindow::innerHeight() const
if (!view)
return 0;
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualHeight() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->height() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::innerWidth() const
@@ -966,7 +970,11 @@ int DOMWindow::innerWidth() const
if (!view)
return 0;
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualWidth() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->width() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::screenX() const
@@ -1004,7 +1012,11 @@ int DOMWindow::scrollX() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualScrollX() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->scrollX() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::scrollY() const
@@ -1018,7 +1030,11 @@ int DOMWindow::scrollY() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualScrollY() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->scrollY() / m_frame->pageZoomFactor());
+#endif
}
bool DOMWindow::closed() const