diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-30 10:37:31 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-30 10:37:31 -0800 |
commit | 25a2029c3de01a4a842eddc0970fb513f615f458 (patch) | |
tree | 28a7097eec79ade539892b2a79c2d6a24c43d5c3 /WebKit/android | |
parent | 86e2f0fb10185de5c83fed0cf4aa6818e5451615 (diff) | |
parent | 0026842c0dc9cc472966e6ef44b707683ca5317b (diff) | |
download | external_webkit-25a2029c3de01a4a842eddc0970fb513f615f458.zip external_webkit-25a2029c3de01a4a842eddc0970fb513f615f458.tar.gz external_webkit-25a2029c3de01a4a842eddc0970fb513f615f458.tar.bz2 |
Merge "Fixed element positioning fix" into honeycomb
Diffstat (limited to 'WebKit/android')
-rw-r--r-- | WebKit/android/WebCoreSupport/PlatformBridge.cpp | 13 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 2 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 9 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 4 |
4 files changed, 28 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp index 0bc2e3c..b34ff8c 100644 --- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp +++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp @@ -159,6 +159,19 @@ FloatRect PlatformBridge::screenRect() return FloatRect(0.0, 0.0, info.w, info.h); } +// The visible size on screen in document coordinate +int PlatformBridge::visibleScreenWidth(const WebCore::FrameView* frameView) +{ + android::WebViewCore* webViewCore = android::WebViewCore::getWebViewCore(frameView); + return webViewCore->visibleScreenWidth(); +} + +int PlatformBridge::visibleScreenHeight(const WebCore::FrameView* frameView) +{ + android::WebViewCore* webViewCore = android::WebViewCore::getWebViewCore(frameView); + return webViewCore->visibleScreenHeight(); +} + String PlatformBridge::computeDefaultLanguage() { #if USE(CHROME_NETWORK_STACK) diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 6ba8276..ef4cf66 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -486,6 +486,8 @@ void WebViewCore::reset(bool fromConstructor) m_scrollOffsetY = 0; m_screenWidth = 0; m_screenHeight = 0; + m_visibleScreenWidth = 0; + m_visibleScreenHeight = 0; m_groupForVisitedLinks = NULL; m_currentNodeDomNavigationAxis = 0; } diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 4357165..a32ce49 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -581,6 +581,10 @@ namespace android { bool isPaused() const { return m_isPaused; } void setIsPaused(bool isPaused) { m_isPaused = isPaused; } bool drawIsPaused() const; + int visibleScreenWidth() const { return m_visibleScreenWidth; } + int visibleScreenHeight() const { return m_visibleScreenHeight; } + void setVisibleScreenWidth(int w) { m_visibleScreenWidth = w; } + void setVisibleScreenHeight(int h) { m_visibleScreenHeight = h; } #if USE(CHROME_NETWORK_STACK) void setWebRequestContextUserAgent(); void setWebRequestContextCacheMode(int mode); @@ -633,6 +637,11 @@ namespace android { CachedHistory m_history; int m_screenWidth; // width of the visible rect in document coordinates int m_screenHeight;// height of the visible rect in document coordinates + // The m_screenHeight is not equal to the visibleRect from WebView, + // using m_visibleScreenHeight to store that info. + // After we can fix the m_screenHeight in java side, we can merge them. + int m_visibleScreenWidth; + int m_visibleScreenHeight; int m_textWrapWidth; float m_scale; unsigned m_domtree_version; diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 0c18d85..0fecf4f 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -481,6 +481,8 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras) SkRect visibleRect; calcOurContentVisibleRect(&visibleRect); + m_viewImpl->setVisibleScreenWidth(visibleRect.width()); + m_viewImpl->setVisibleScreenHeight(visibleRect.height()); bool ret = m_baseLayer->drawGL(viewRect, visibleRect, scale); if (ret || m_glWebViewState->currentPictureCounter() != pic) return true; @@ -543,6 +545,8 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, int extras, bool split) compositeLayer->setExtra(extra); SkRect visible; calcOurContentVisibleRect(&visible); + m_viewImpl->setVisibleScreenWidth(visible.width()); + m_viewImpl->setVisibleScreenHeight(visible.height()); // call this to be sure we've adjusted for any scrolling or animations // before we actually draw compositeLayer->updateFixedLayersPositions(visible); |