summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CacheBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/nav/CacheBuilder.cpp')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp11
1 files changed, 7 insertions, 4 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;
}