summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp8
-rw-r--r--WebKit/android/nav/CachedFrame.cpp2
-rw-r--r--WebKit/android/nav/CachedFrame.h6
3 files changed, 13 insertions, 3 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 22b449a..47c7c70 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -1493,8 +1493,14 @@ bool CacheBuilder::CleanUpContainedNodes(CachedRoot* cachedRoot,
if (onlyChildCached->parent() == lastCached)
onlyChildCached->setParentIndex(lastCached->parentIndex());
bool hasFocus = lastCached->isFocus() || onlyChildCached->isFocus();
- if (outerIsMouseMoveOnly || onlyChild->isKeyboardFocusable(NULL))
+ if (outerIsMouseMoveOnly || onlyChild->isKeyboardFocusable(NULL)) {
+ int index = lastCached->index();
*lastCached = *onlyChildCached;
+ lastCached->setIndex(index);
+ CachedFrame* frame = cachedFrame->hasFrame(lastCached);
+ if (frame)
+ frame->setIndexInParent(index);
+ }
cachedFrame->removeLast();
if (hasFocus)
cachedRoot->setCachedFocus(cachedFrame, cachedFrame->lastNode());
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp
index 8f0df7a..4f9ec06 100644
--- a/WebKit/android/nav/CachedFrame.cpp
+++ b/WebKit/android/nav/CachedFrame.cpp
@@ -918,7 +918,7 @@ const CachedNode* CachedFrame::frameUp(const CachedNode* test,
return bestData->mNode;
}
-const CachedFrame* CachedFrame::hasFrame(const CachedNode* node) const
+CachedFrame* CachedFrame::hasFrame(const CachedNode* node)
{
return node->isFrame() ? &mCachedFrames[node->childFrameIndex()] : NULL;
}
diff --git a/WebKit/android/nav/CachedFrame.h b/WebKit/android/nav/CachedFrame.h
index fdee849..8ca73cf 100644
--- a/WebKit/android/nav/CachedFrame.h
+++ b/WebKit/android/nav/CachedFrame.h
@@ -112,7 +112,10 @@ public:
void* framePointer() const { return mFrame; }
CachedNode* getIndex(int index) { return index >= 0 ?
&mCachedNodes[index] : NULL; }
- const CachedFrame* hasFrame(const CachedNode* node) const;
+ const CachedFrame* hasFrame(const CachedNode* node) const {
+ return const_cast<CachedFrame*>(this)->hasFrame(node);
+ }
+ CachedFrame* hasFrame(const CachedNode* node);
void hideCursor();
int indexInParent() const { return mIndexInParent; }
void init(const CachedRoot* root, int index, WebCore::Frame* frame);
@@ -143,6 +146,7 @@ public:
void setData();
bool setFocus(WebCore::Frame* , WebCore::Node* , int x, int y);
void setFocusIndex(int index) { mFocusIndex = index; }
+ void setIndexInParent(int index) { mIndexInParent = index; }
void setLocalViewBounds(const WebCore::IntRect& bounds) { mLocalViewBounds = bounds; }
int size() { return mCachedNodes.size(); }
const CachedInput* textInput(const CachedNode* node) const {