diff options
Diffstat (limited to 'WebKit/android/nav/CachedRoot.cpp')
-rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 2354ebc..e783eae 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -756,14 +756,17 @@ bool CachedRoot::checkRings(const WTF::Vector<WebCore::IntRect>& rings, return ringCheck.success(); } -CachedRoot::ImeAction CachedRoot::cursorTextFieldAction() const +CachedRoot::ImeAction CachedRoot::currentTextFieldAction() const { - const CachedFrame* cursorFrame; - const CachedNode* cursor = currentCursor(&cursorFrame); - if (!cursor) { - // Error case. The cursor has no action, because there is no node under - // the cursor - return FAILURE; + const CachedFrame* currentFrame; + const CachedNode* current = currentCursor(¤tFrame); + if (!current) { + // Although the cursor is not on a textfield, a textfield may have + // focus. Find the action for that textfield. + current = currentFocus(¤tFrame); + if (!current) + // Error case. No cursor and no focus. + return FAILURE; } const CachedNode* firstTextfield = nextTextField(0, 0, false); if (!firstTextfield) { @@ -773,8 +776,8 @@ CachedRoot::ImeAction CachedRoot::cursorTextFieldAction() const // Now find the next textfield/area starting with the cursor const CachedFrame* potentialFrame; const CachedNode* potentialNext - = cursorFrame->nextTextField(cursor, &potentialFrame, true); - if (potentialNext && cursorFrame->textInput(cursor)->formPointer() + = currentFrame->nextTextField(current, &potentialFrame, true); + if (potentialNext && currentFrame->textInput(current)->formPointer() == potentialFrame->textInput(potentialNext)->formPointer()) { // There is a textfield/area after the cursor in the same form, // so the textfield under the cursor should have the NEXT action @@ -797,7 +800,7 @@ const CachedNode* CachedRoot::findAt(const WebCore::IntRect& rect, DBG_NAV_LOGD("node=%d (%p)", node == NULL ? 0 : node->index(), node == NULL ? NULL : node->nodePointer()); if (node == NULL) { - node = findBestHitAt(rect, &best, framePtr, x, y); + node = findBestHitAt(rect, framePtr, x, y); DBG_NAV_LOGD("node=%d (%p)", node == NULL ? 0 : node->index(), node == NULL ? NULL : node->nodePointer()); } |