summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-03-10 16:47:32 -0500
committerCary Clark <cary@android.com>2010-03-11 08:30:11 -0500
commitd9b61293c215024b9b0a6263c4ea87a5867b0826 (patch)
tree032ee001ddb31c4e091addeedcfa8705f5f7156c /WebKit/android/jni
parentd24e8d919076d7fcbf862daa2a1164e13c0d7af9 (diff)
downloadexternal_webkit-d9b61293c215024b9b0a6263c4ea87a5867b0826.zip
external_webkit-d9b61293c215024b9b0a6263c4ea87a5867b0826.tar.gz
external_webkit-d9b61293c215024b9b0a6263c4ea87a5867b0826.tar.bz2
set the cached focus state when a node is in a fixed layer
The newly built nav cache needs the layer information set before it attempts to set the focus so the nodes' bounds are set correctly. Change-Id: I72ff03988c267388da5921ac85b0ac0f6fb2374a http://2503096
Diffstat (limited to 'WebKit/android/jni')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp23
-rw-r--r--WebKit/android/jni/WebViewCore.h2
2 files changed, 19 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 9cbeb71..1df6be8 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -137,7 +137,6 @@ FILE* gRenderTreeFile = 0;
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayerAndroid.h"
-#include "LayerAndroid.h"
#include "RenderLayerCompositor.h"
#endif
@@ -1344,6 +1343,11 @@ void WebViewCore::updateFrameCache()
#endif
m_temp = new CachedRoot();
m_temp->init(m_mainFrame, &m_history);
+#if USE(ACCELERATED_COMPOSITING)
+ GraphicsLayerAndroid* graphicsLayer = graphicsRootLayer();
+ if (graphicsLayer)
+ m_temp->setRootLayer(graphicsLayer->contentLayer());
+#endif
CacheBuilder& builder = cacheBuilder();
WebCore::Settings* settings = m_mainFrame->page()->settings();
builder.allowAllTextDetection();
@@ -1962,16 +1966,23 @@ void WebViewCore::click(WebCore::Frame* frame, WebCore::Node* node) {
}
}
+#if USE(ACCELERATED_COMPOSITING)
+GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const
+{
+ RenderView* contentRenderer = m_mainFrame->contentRenderer();
+ if (!contentRenderer)
+ return 0;
+ return static_cast<GraphicsLayerAndroid*>(
+ contentRenderer->compositor()->rootPlatformLayer());
+}
+#endif
+
bool WebViewCore::handleTouchEvent(int action, int x, int y, int metaState)
{
bool preventDefault = false;
#if USE(ACCELERATED_COMPOSITING)
- RenderView* contentRenderer = m_mainFrame->contentRenderer();
- GraphicsLayerAndroid* rootLayer = 0;
- if (contentRenderer)
- rootLayer = static_cast<GraphicsLayerAndroid*>(
- contentRenderer->compositor()->rootPlatformLayer());
+ GraphicsLayerAndroid* rootLayer = graphicsRootLayer();
if (rootLayer)
rootLayer->pauseDisplay(true);
#endif
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index 7883cdd..2bb45a6 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -60,6 +60,7 @@ namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
namespace WebCore {
+ class GraphicsLayerAndroid;
class LayerAndroid;
}
#endif
@@ -135,6 +136,7 @@ namespace android {
void contentDraw();
#if USE(ACCELERATED_COMPOSITING)
+ GraphicsLayerAndroid* graphicsRootLayer() const;
void immediateRepaint();
void setUIRootLayer(const LayerAndroid* layer);
#endif