summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-10-01 06:57:35 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-01 06:57:35 -0700
commit8dd042ec5ff3a28fd7e0291b0b092a98306229f7 (patch)
treeaca5b24b957a42649b8b46d628d782d4f5d16033 /WebKit/android/nav
parent71d8d800bdd87cd1aa95f64cd8586b8e3d1f1479 (diff)
parent8180f8161470f2d0d6080c64149cf25ed3b755a5 (diff)
downloadexternal_webkit-8dd042ec5ff3a28fd7e0291b0b092a98306229f7.zip
external_webkit-8dd042ec5ff3a28fd7e0291b0b092a98306229f7.tar.gz
external_webkit-8dd042ec5ff3a28fd7e0291b0b092a98306229f7.tar.bz2
am 8180f816: Do not merge: fix array overwrite crasher
Merge commit '8180f8161470f2d0d6080c64149cf25ed3b755a5' into gingerbread-plus-aosp * commit '8180f8161470f2d0d6080c64149cf25ed3b755a5': Do not merge: fix array overwrite crasher
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp11
-rw-r--r--WebKit/android/nav/CacheBuilder.h2
2 files changed, 8 insertions, 5 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 7ee2a16..214058c 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -960,7 +960,7 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
FocusTracker* last = &tracker.last();
int lastChildIndex = cachedFrame->size() - 1;
while (node == last->mLastChild) {
- if (CleanUpContainedNodes(cachedFrame, last, lastChildIndex))
+ if (CleanUpContainedNodes(cachedRoot, cachedFrame, last, lastChildIndex))
cacheIndex--;
tracker.removeLast();
lastChildIndex = last->mCachedNodeIndex;
@@ -1344,14 +1344,14 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
while (tracker.size() > 1) {
FocusTracker* last = &tracker.last();
int lastChildIndex = cachedFrame->size() - 1;
- if (CleanUpContainedNodes(cachedFrame, last, lastChildIndex))
+ if (CleanUpContainedNodes(cachedRoot, cachedFrame, last, lastChildIndex))
cacheIndex--;
tracker.removeLast();
}
}
-bool CacheBuilder::CleanUpContainedNodes(CachedFrame* cachedFrame,
- const FocusTracker* last, int lastChildIndex)
+bool CacheBuilder::CleanUpContainedNodes(CachedRoot* cachedRoot,
+ CachedFrame* cachedFrame, const FocusTracker* last, int lastChildIndex)
{
// if outer is body, disable outer
// or if there's more than one inner, disable outer
@@ -1380,9 +1380,12 @@ bool CacheBuilder::CleanUpContainedNodes(CachedFrame* cachedFrame,
HasTriggerEvent(lastNode) == false;
if (onlyChildCached->parent() == lastCached)
onlyChildCached->setParentIndex(lastCached->parentIndex());
+ bool hasFocus = lastCached->isFocus() || onlyChildCached->isFocus();
if (outerIsMouseMoveOnly || onlyChild->isKeyboardFocusable(NULL))
*lastCached = *onlyChildCached;
cachedFrame->removeLast();
+ if (hasFocus)
+ cachedRoot->setCachedFocus(cachedFrame, cachedFrame->lastNode());
return true;
}
diff --git a/WebKit/android/nav/CacheBuilder.h b/WebKit/android/nav/CacheBuilder.h
index 4ded58d..407d590 100644
--- a/WebKit/android/nav/CacheBuilder.h
+++ b/WebKit/android/nav/CacheBuilder.h
@@ -215,7 +215,7 @@ private:
static bool NodeHasEventListeners(Node* node, AtomicString* eventTypes, int length);
void BuildFrame(Frame* root, Frame* frame,
CachedRoot* cachedRoot, CachedFrame* cachedFrame);
- bool CleanUpContainedNodes(CachedFrame* cachedFrame,
+ bool CleanUpContainedNodes(CachedRoot* cachedRoot, CachedFrame* cachedFrame,
const FocusTracker* last, int lastChildIndex);
static bool ConstructTextRect(Text* textNode,
InlineTextBox* textBox, int start, int relEnd, int x, int y,