summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2009-09-15 10:13:21 -0400
committerCary Clark <cary@android.com>2009-09-15 10:13:21 -0400
commitb90cf0b22394fa98aba20f711be42f94184b482c (patch)
tree7ac9607ac4e58e6fc1b7fc46c3ec48b795a44a0a /WebKit/android/nav
parenta8185118f3bc09b1874f02cd0b95a6397723f31b (diff)
downloadexternal_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/android/nav')
-rw-r--r--WebKit/android/nav/CachedFrame.cpp3
-rw-r--r--WebKit/android/nav/CachedRoot.cpp2
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();