summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-03-05 14:41:28 +0000
committerNicolas Roard <nicolas@android.com>2010-03-09 19:13:10 +0000
commitfa26a8dd531dff44d6cad0700ff32c0bb949392c (patch)
tree2984a63001721ee4143e4ad88797fa0dbd1a4b1d /WebKit/android
parent7332bc6f7a4d9ccd11185104fb0aa1a0c9b84ac0 (diff)
downloadexternal_webkit-fa26a8dd531dff44d6cad0700ff32c0bb949392c.zip
external_webkit-fa26a8dd531dff44d6cad0700ff32c0bb949392c.tar.gz
external_webkit-fa26a8dd531dff44d6cad0700ff32c0bb949392c.tar.bz2
Fix bug 'Children of fixed elements do not always remain fixed themselves'
The problem was twofold: - webkit didn't create composited layers of the children div unless they were intersecting with the fixed layer - the children divs layers are siblings, not children of the fixed layer The solution is to: 1/ mark layers as needed to be composited if their ancestor is a fixed element (in RenderLayerCompositor) 2/ as the GraphicsLayer/LayerAndroid hierarchy is based on the RenderLayer hierarchy (z-order..) and not the display hierarchy, we need to a way of updating the position of the contained layers when a fixed layer move. We do that by: - marking layers contained in a fixed layer as being linked to the fixed layer (GraphicsLayerAndroid::syncFixedDescendants), and set the offset between the layer and the fixed layer. - when pushing the layers tree to the UI side, we ensure that such layers are linked to their corresponding fixed layer (LayerAndroid::ensureFixedLayersForDescendants) - when we draw, we do a first pass to update the fixed layers position (LayerAndroid::updateFixedLayersPositions) then update the rest of the layers (LayerAndroid::updatePositions). The layers that are linked to the fixed layers will then update their position relative to it, using the original offset between the fixed layer and the layer. Bug:2470701 Change-Id: I512966df94de6a5f84aff335c5d09b3f027bc2c3
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/nav/WebView.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 2c6b538..86f8797 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -294,7 +294,8 @@ void scrollRectOnScreen(const IntRect& rect)
calcOurContentVisibleRect(&visible);
#if USE(ACCELERATED_COMPOSITING)
if (m_rootLayer) {
- m_rootLayer->updatePositions(visible);
+ m_rootLayer->updateFixedLayersPositions(visible);
+ m_rootLayer->updatePositions();
visible = m_rootLayer->subtractLayers(visible);
}
#endif
@@ -421,7 +422,8 @@ void drawExtras(SkCanvas* canvas, int extras)
calcOurContentVisibleRect(&visible);
// call this to be sure we've adjusted for any scrolling or animations
// before we actually draw
- m_rootLayer->updatePositions(visible);
+ m_rootLayer->updateFixedLayersPositions(visible);
+ m_rootLayer->updatePositions();
m_rootLayer->draw(canvas);
#endif
}
@@ -548,7 +550,8 @@ CachedRoot* getFrameCache(FrameCachePermission allowNewer)
LayerAndroid* layer = const_cast<LayerAndroid*>(
m_frameCacheUI->rootLayer());
if (layer) {
- layer->updatePositions(visible);
+ layer->updateFixedLayersPositions(visible);
+ layer->updatePositions();
}
}
#endif