From b90cf0b22394fa98aba20f711be42f94184b482c Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 15 Sep 2009 10:13:21 -0400 Subject: 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 --- WebKit/android/nav/CachedFrame.cpp | 3 +++ WebKit/android/nav/CachedRoot.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'WebKit') 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(); -- cgit v1.1