From 0026842c0dc9cc472966e6ef44b707683ca5317b Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Fri, 28 Jan 2011 14:00:43 -0800 Subject: Fixed element positioning fix This is for fixed bottom/ right, in the zooming case. The width and height in webkit should be calculated as the visibleRect we use for drawing. And that is document coordinate for visible size. Basically it is send the Rect info from webView to webViewCore. Then at RenderBox, it will go through the PlatformBridge to pick the info up. Notice that the touch is not 100% working yet, the layout call in webkit can have a early return such that fixed element layer didn't get update. And a touch/click is not really causing the whole layout update yet. That will be addressed in seperate change though. bug:3404129 Change-Id: I225d41815143a05d540ed32bfc76f823603ca89c --- WebKit/android/nav/WebView.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'WebKit/android/nav') diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 16ec826..573718b 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -474,6 +474,8 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras) m_glWebViewState->setExtra(m_baseLayer, picture, rect); 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; @@ -536,6 +538,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); -- cgit v1.1