summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-03-15 16:34:21 -0400
committerCary Clark <cary@android.com>2010-03-15 16:34:21 -0400
commit3a752d13620eb15148e87a028d66932c74a27993 (patch)
treeea984a7dd08905415ba433c4b7e4d7b3613ce1cc /WebKit/android/nav
parent066d41ff6c2a4b04f02691ff45c0ffd3c044ea8a (diff)
downloadexternal_webkit-3a752d13620eb15148e87a028d66932c74a27993.zip
external_webkit-3a752d13620eb15148e87a028d66932c74a27993.tar.gz
external_webkit-3a752d13620eb15148e87a028d66932c74a27993.tar.bz2
read old focus before it's thrown away
Change-Id: Iab6a64aec5f146e8b0286d1249d353567b49ea49 http://b/2515977
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r--WebKit/android/nav/WebView.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 86f8797..8344cf7 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -531,7 +531,15 @@ CachedRoot* getFrameCache(FrameCachePermission allowNewer)
}
#endif
// get id from old layer and use to find new layer
- const CachedNode* oldFocus = m_frameCacheUI ? m_frameCacheUI->currentFocus() : 0;
+ bool oldFocusIsTextInput = false;
+ void* oldFocusNodePointer = 0;
+ if (m_frameCacheUI) {
+ const CachedNode* oldFocus = m_frameCacheUI->currentFocus();
+ if (oldFocus) {
+ oldFocusIsTextInput = oldFocus->isTextInput();
+ oldFocusNodePointer = oldFocus->nodePointer();
+ }
+ }
m_viewImpl->gFrameCacheMutex.lock();
delete m_frameCacheUI;
delete m_navPictureUI;
@@ -556,10 +564,10 @@ CachedRoot* getFrameCache(FrameCachePermission allowNewer)
}
#endif
fixCursor();
- if (oldFocus && m_frameCacheUI) {
+ if (oldFocusIsTextInput) {
const CachedNode* newFocus = m_frameCacheUI->currentFocus();
- if (newFocus && oldFocus->nodePointer() != newFocus->nodePointer()
- && oldFocus->isTextInput() && newFocus->isTextInput()
+ if (newFocus && oldFocusNodePointer != newFocus->nodePointer()
+ && newFocus->isTextInput()
&& newFocus != m_frameCacheUI->currentCursor()) {
// The focus has changed. We may need to update things.
LOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!");