summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-12-10 13:33:40 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-10 13:33:40 -0800
commit1f39d2d9fa8ad17be2edeb570a625ed331f5a8f1 (patch)
tree8ad5b9878ce70cd2cd644cf49b21f9b930a6c1ed /WebKit
parentcfd8cdfd5146057393cae8ffe65d27b903d9f62d (diff)
parent3b242d089e9d96995ad22fb2ed76fa1a9533eb64 (diff)
downloadexternal_webkit-1f39d2d9fa8ad17be2edeb570a625ed331f5a8f1.zip
external_webkit-1f39d2d9fa8ad17be2edeb570a625ed331f5a8f1.tar.gz
external_webkit-1f39d2d9fa8ad17be2edeb570a625ed331f5a8f1.tar.bz2
am 3b242d08: am 91a3bec8: Show "Go" for the last textfield in a form.
Merge commit '3b242d089e9d96995ad22fb2ed76fa1a9533eb64' * commit '3b242d089e9d96995ad22fb2ed76fa1a9533eb64': Show "Go" for the last textfield in a form.
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp2
-rw-r--r--WebKit/android/nav/CachedInput.cpp1
-rw-r--r--WebKit/android/nav/CachedInput.h3
-rw-r--r--WebKit/android/nav/CachedRoot.cpp10
4 files changed, 13 insertions, 3 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 522d381..f854e71 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -1101,6 +1101,7 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
if (input->isTextField()) {
type = TEXT_INPUT_CACHEDNODETYPE;
cachedInput.init();
+ cachedInput.setFormPointer(input->form());
cachedInput.setIsTextField(true);
cachedInput.setIsReadOnly(input->readOnly());
exported = input->value().threadsafeCopy();
@@ -1117,6 +1118,7 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
cachedInput.init();
type = TEXT_INPUT_CACHEDNODETYPE;
HTMLTextAreaElement* area = static_cast<HTMLTextAreaElement*>(node);
+ cachedInput.setFormPointer(area->form());
cachedInput.setIsReadOnly(area->readOnly());
// Although technically it is not an HTMLInputElement, and therefore
// has no InputType, this one is the most appropriate.
diff --git a/WebKit/android/nav/CachedInput.cpp b/WebKit/android/nav/CachedInput.cpp
index 858402f..52d2066 100644
--- a/WebKit/android/nav/CachedInput.cpp
+++ b/WebKit/android/nav/CachedInput.cpp
@@ -50,6 +50,7 @@ void CachedInput::Debug::print() const
scratch[index++] = c;
}
DUMP_NAV_LOGD("%.*s\"\n", index, scratch);
+ DUMP_NAV_LOGD("// void* mForm=%p;", b->mForm);
DUMP_NAV_LOGD("// int mMaxLength=%d;\n", b->mMaxLength);
DUMP_NAV_LOGD("// int mTextSize=%d;\n", b->mTextSize);
DUMP_NAV_LOGD("// int mInputType=%d;\n", b->mInputType);
diff --git a/WebKit/android/nav/CachedInput.h b/WebKit/android/nav/CachedInput.h
index f4f0e95..f3cf1fe 100644
--- a/WebKit/android/nav/CachedInput.h
+++ b/WebKit/android/nav/CachedInput.h
@@ -38,6 +38,7 @@ public:
// Initiaized to 0 in its array, so nothing to do in the
// constructor
}
+ void* formPointer() const { return mForm; }
void init() {
bzero(this, sizeof(CachedInput));
mName = WebCore::String();
@@ -48,6 +49,7 @@ public:
bool isTextField() const { return mIsTextField; }
int maxLength() const { return mMaxLength; };
const WebCore::String& name() const { return mName; }
+ void setFormPointer(void* form) { mForm = form; }
void setInputType(WebCore::HTMLInputElement::InputType type) { mInputType = type; }
void setIsReadOnly(bool isReadOnly) { mIsReadOnly = isReadOnly; }
void setIsRtlText(bool isRtlText) { mIsRtlText = isRtlText; }
@@ -57,6 +59,7 @@ public:
void setTextSize(int textSize) { mTextSize = textSize; }
int textSize() const { return mTextSize; }
private:
+ void* mForm;
WebCore::String mName;
int mMaxLength;
int mTextSize;
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp
index 0011f06..2354ebc 100644
--- a/WebKit/android/nav/CachedRoot.cpp
+++ b/WebKit/android/nav/CachedRoot.cpp
@@ -771,9 +771,13 @@ CachedRoot::ImeAction CachedRoot::cursorTextFieldAction() const
return FAILURE;
}
// Now find the next textfield/area starting with the cursor
- if (cursorFrame->nextTextField(cursor, 0, true)) {
- // There is a textfield/area after the cursor, so the textfield under
- // the cursor should have the NEXT action
+ const CachedFrame* potentialFrame;
+ const CachedNode* potentialNext
+ = cursorFrame->nextTextField(cursor, &potentialFrame, true);
+ if (potentialNext && cursorFrame->textInput(cursor)->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
return NEXT;
}
// If this line is reached, we know that the textfield under the cursor is