diff options
author | Cary Clark <cary@android.com> | 2010-11-18 11:32:25 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-18 11:32:25 -0800 |
commit | 4ed81ac4810cd587cc2afc3b7f292c1281eca93a (patch) | |
tree | 69414ae60ebcae11bc2788e71471da13c9d80a69 /WebKit | |
parent | e5a6dbead6bec691c53e326500d9aa3339fda872 (diff) | |
parent | 908643d12d19aa4f2d69c47d5c1d4243da8ddfb7 (diff) | |
download | external_webkit-4ed81ac4810cd587cc2afc3b7f292c1281eca93a.zip external_webkit-4ed81ac4810cd587cc2afc3b7f292c1281eca93a.tar.gz external_webkit-4ed81ac4810cd587cc2afc3b7f292c1281eca93a.tar.bz2 |
Merge "fix indices in cached frame"
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 8 | ||||
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 2 | ||||
-rw-r--r-- | WebKit/android/nav/CachedFrame.h | 6 |
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 { |