diff options
author | Leon Scroggins <scroggo@google.com> | 2009-07-30 16:29:30 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-07-31 11:33:01 -0400 |
commit | e3635bdd4530eeff44657cb1423a0572482381ce (patch) | |
tree | 10560cd9ed79aaa8d4faac770518e7cf3982f938 /WebKit/android/nav/CachedFrame.cpp | |
parent | 7ed73b9c2878d611c2c6954665d21aa6f162d5cc (diff) | |
download | external_webkit-e3635bdd4530eeff44657cb1423a0572482381ce.zip external_webkit-e3635bdd4530eeff44657cb1423a0572482381ce.tar.gz external_webkit-e3635bdd4530eeff44657cb1423a0572482381ce.tar.bz2 |
Allow user to jump to the next textfield.
In CachedFrame, add methods to find the next textfield and to
determine which ImeAction should be associated with a given textfield.
In WebView, uses these apis to determine the ImeAction and jump
to the next textfield and scroll it on screen. Requires a change to
frameworks/base.
Diffstat (limited to 'WebKit/android/nav/CachedFrame.cpp')
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 4bf9805..416e880 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -891,6 +891,34 @@ int CachedFrame::maxWorkingVertical() const return history()->maxWorkingVertical(); } +const CachedNode* CachedFrame::nextTextField(const CachedNode* start, + const CachedFrame** framePtr, bool includeTextAreas) const +{ + CachedNode* test; + if (start) { + test = const_cast<CachedNode*>(start); + test++; + } else { + test = const_cast<CachedNode*>(mCachedNodes.begin()); + } + while (test != mCachedNodes.end()) { + CachedFrame* frame = const_cast<CachedFrame*>(hasFrame(test)); + if (frame) { + const CachedNode* node + = frame->nextTextField(0, framePtr, includeTextAreas); + if (node) + return node; + } else if (test->isTextField() + || (includeTextAreas && test->isTextArea())) { + if (framePtr) + *framePtr = this; + return test; + } + test++; + } + return 0; +} + bool CachedFrame::moveInFrame(MoveInDirection moveInDirection, const CachedNode* test, BestData* bestData, const CachedNode* cursor) const |