diff options
author | Patrick Scott <phanna@android.com> | 2011-01-26 14:32:43 -0500 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2011-01-26 14:40:13 -0500 |
commit | 1a8ec29fc0211a6b5c53a8cd9ce20be5e630b005 (patch) | |
tree | 55e946356ee808b204dbbc65db779f78a638fd19 /WebKit | |
parent | 85e27b62cf6f85f2e8d5694b285be78a3a090b22 (diff) | |
download | external_webkit-1a8ec29fc0211a6b5c53a8cd9ce20be5e630b005.zip external_webkit-1a8ec29fc0211a6b5c53a8cd9ce20be5e630b005.tar.gz external_webkit-1a8ec29fc0211a6b5c53a8cd9ce20be5e630b005.tar.bz2 |
Fix hit testing inside layers.
A new webkit merge added a couple methods to ClipRects that were not copying the
hit test rect. This make the clip rect empty during hit testing which was
clipping out all nodes in scrollable layers.
When tracking a layer, use the foreground layer if present as it will contain
the right nodes.
When looking for a scrollable layer, traverse the children in reverse drawing
order to find the top-most visible layer. This allows orkut.com to scroll.
Remove a couple of casts and headers. Use relaxAdoptionRequirement() to avoid a
RefCounted assert. Swap the texture owner hash set during deletion as release
can modify the iterator concurrently.
Update the scrollbars (even though we don't have any) when scrolling a layer to
keep the scroll position of the scrollbar in sync with the layer.
Rewrite a little bit of PluginPackageAndroid. m_module may be non-null during
load. If it is null, load the library and store it in m_module. Follow the
regular path assuming m_module is not null.
Bug: 3373179
Change-Id: If07ec9735b30c1e98e363667378a8d253a841a45
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 1 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 14 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/plugins/PluginTimer.cpp | 1 |
5 files changed, 12 insertions, 12 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index cb1efe1..f0958d9 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -37,7 +37,6 @@ #include "FrameLoader.h" #include "FrameView.h" #include "Geolocation.h" -#include "GraphicsLayerAndroid.h" #include "Icon.h" #include "Page.h" #include "PopupMenuAndroid.h" diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 39f6f2d..fe1d0db 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -2964,7 +2964,7 @@ static void scrollLayer(WebCore::RenderObject* renderer, WebCore::IntPoint* pos) return; // The cache uses absolute coordinates when clicking on nodes and it assumes // the layer is not scrolled. - layer->scrollToOffset(0, 0, false, false); + layer->scrollToOffset(0, 0, true, false); WebCore::IntRect absBounds = renderer->absoluteBoundingBoxRect(); // Do not include the outline when moving the node's bounds. @@ -2974,7 +2974,7 @@ static void scrollLayer(WebCore::RenderObject* renderer, WebCore::IntPoint* pos) absBounds.move(-layerBounds.x(), -layerBounds.y()); // Scroll the layer to the node's position. - layer->scrollToOffset(absBounds.x(), absBounds.y(), false, true); + layer->scrollToOffset(absBounds.x(), absBounds.y(), true, true); // Update the mouse position to the layer offset. pos->move(-layer->scrollXOffset(), -layer->scrollYOffset()); diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index 40b2711..135bacc 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -36,7 +36,6 @@ #include "FrameTree.h" #include "FrameView.h" //#include "GraphicsContext.h" -#include "GraphicsLayerAndroid.h" #include "HTMLAreaElement.h" #include "HTMLImageElement.h" #include "HTMLInputElement.h" @@ -47,6 +46,7 @@ #include "HTMLTextAreaElement.h" #include "InlineTextBox.h" #include "KURL.h" +#include "LayerAndroid.h" #include "PluginView.h" #include "RegisteredEventListener.h" #include "RenderImage.h" @@ -508,9 +508,8 @@ void CacheBuilder::Debug::groups() { if (renderer && renderer->hasLayer()) { RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); RenderLayerBacking* back = layer->backing(); - GraphicsLayerAndroid* grLayer = static_cast - <GraphicsLayerAndroid*>(back ? back->graphicsLayer() : 0); - LayerAndroid* aLayer = grLayer ? grLayer->contentLayer() : 0; + GraphicsLayer* grLayer = back ? back->graphicsLayer() : 0; + LayerAndroid* aLayer = grLayer ? grLayer->platformLayer() : 0; const SkPicture* pict = aLayer ? aLayer->picture() : 0; const IntRect& r = renderer->absoluteBoundingBoxRect(); snprintf(scratch, sizeof(scratch), "// layer:%p back:%p" @@ -2906,11 +2905,12 @@ void CacheBuilder::TrackLayer(WTF::Vector<LayerTracker>& layerTracker, RenderLayerBacking* back = layer->backing(); if (!back) return; - GraphicsLayerAndroid* grLayer = static_cast - <GraphicsLayerAndroid*>(back->graphicsLayer()); + GraphicsLayer* grLayer = back->graphicsLayer(); + if (back->hasContentsLayer()) + grLayer = back->foregroundLayer(); if (!grLayer) return; - LayerAndroid* aLayer = grLayer->contentLayer(); + LayerAndroid* aLayer = grLayer->platformLayer(); if (!aLayer) return; IntPoint scroll(layer->scrollXOffset(), layer->scrollYOffset()); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 683c2a3..28babc0 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -1022,8 +1022,8 @@ static const ScrollableLayerAndroid* findScrollableLayer( x -= bounds.fLeft; y -= bounds.fTop; int count = parent->countChildren(); - for (int i = 0; i < count; i++) { - const LayerAndroid* child = parent->getChild(i); + while (count--) { + const LayerAndroid* child = parent->getChild(count); const ScrollableLayerAndroid* result = findScrollableLayer(child, x, y, foundBounds); if (result) { diff --git a/WebKit/android/plugins/PluginTimer.cpp b/WebKit/android/plugins/PluginTimer.cpp index 23cac77..9ed6a80 100644 --- a/WebKit/android/plugins/PluginTimer.cpp +++ b/WebKit/android/plugins/PluginTimer.cpp @@ -48,6 +48,7 @@ namespace WebCore { } m_prev = 0; *list = this; + relaxAdoptionRequirement(); } PluginTimer::~PluginTimer() |