diff options
Diffstat (limited to 'WebKit/android/nav/CacheBuilder.cpp')
| -rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index 7ee2a16..f69b23d 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -960,7 +960,7 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, FocusTracker* last = &tracker.last(); int lastChildIndex = cachedFrame->size() - 1; while (node == last->mLastChild) { - if (CleanUpContainedNodes(cachedFrame, last, lastChildIndex)) + if (CleanUpContainedNodes(cachedRoot, cachedFrame, last, lastChildIndex)) cacheIndex--; tracker.removeLast(); lastChildIndex = last->mCachedNodeIndex; @@ -1232,6 +1232,10 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, || style->textAlign() == WebCore::RIGHT || style->textAlign() == WebCore::WEBKIT_RIGHT); } + cachedInput.setPaddingLeft(renderText->paddingLeft() + renderText->borderLeft()); + cachedInput.setPaddingTop(renderText->paddingTop() + renderText->borderTop()); + cachedInput.setPaddingRight(renderText->paddingRight() + renderText->borderRight()); + cachedInput.setPaddingBottom(renderText->paddingBottom() + renderText->borderBottom()); } takesFocus = true; bounds = absBounds; @@ -1344,14 +1348,14 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, while (tracker.size() > 1) { FocusTracker* last = &tracker.last(); int lastChildIndex = cachedFrame->size() - 1; - if (CleanUpContainedNodes(cachedFrame, last, lastChildIndex)) + if (CleanUpContainedNodes(cachedRoot, cachedFrame, last, lastChildIndex)) cacheIndex--; tracker.removeLast(); } } -bool CacheBuilder::CleanUpContainedNodes(CachedFrame* cachedFrame, - const FocusTracker* last, int lastChildIndex) +bool CacheBuilder::CleanUpContainedNodes(CachedRoot* cachedRoot, + CachedFrame* cachedFrame, const FocusTracker* last, int lastChildIndex) { // if outer is body, disable outer // or if there's more than one inner, disable outer @@ -1380,9 +1384,12 @@ bool CacheBuilder::CleanUpContainedNodes(CachedFrame* cachedFrame, HasTriggerEvent(lastNode) == false; if (onlyChildCached->parent() == lastCached) onlyChildCached->setParentIndex(lastCached->parentIndex()); + bool hasFocus = lastCached->isFocus() || onlyChildCached->isFocus(); if (outerIsMouseMoveOnly || onlyChild->isKeyboardFocusable(NULL)) *lastCached = *onlyChildCached; cachedFrame->removeLast(); + if (hasFocus) + cachedRoot->setCachedFocus(cachedFrame, cachedFrame->lastNode()); return true; } |
