diff options
author | Cary Clark <cary@android.com> | 2009-09-15 10:13:21 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-09-15 10:13:21 -0400 |
commit | b90cf0b22394fa98aba20f711be42f94184b482c (patch) | |
tree | 7ac9607ac4e58e6fc1b7fc46c3ec48b795a44a0a /WebKit | |
parent | a8185118f3bc09b1874f02cd0b95a6397723f31b (diff) | |
download | external_webkit-b90cf0b22394fa98aba20f711be42f94184b482c.zip external_webkit-b90cf0b22394fa98aba20f711be42f94184b482c.tar.gz external_webkit-b90cf0b22394fa98aba20f711be42f94184b482c.tar.bz2 |
fix parent index of focus when building nav cache
When a focused node is found while walking the DOM, the
CachedFrame tree doesn't have its parent pointer set.
Fix the focus index in the parent when fixing the parent pointer.
Also fix a debug statement so that it doesn't depend on
the focus parent.
Fixes http://b/issue?id=2048186
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 3 | ||||
-rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 416e880..955a439 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -578,6 +578,9 @@ void CachedFrame::finishInit() child->finishInit(); child++; } + CachedFrame* frameParent; + if (mFocusIndex >= 0 && (frameParent = parent())) + frameParent->setFocusIndex(indexInParent()); } const CachedNode* CachedFrame::frameDown(const CachedNode* test, const CachedNode* limit, BestData* bestData, diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 102da39..595b4b5 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -1256,7 +1256,7 @@ void CachedRoot::setCachedFocus(CachedFrame* frame, CachedNode* node) frame = parent; } #if DEBUG_NAV_UI - const CachedNode* focus = currentFocus(); + const CachedNode* focus = frame->currentFocus(); WebCore::IntRect bounds = WebCore::IntRect(0, 0, 0, 0); if (focus) bounds = focus->bounds(); |