diff options
| author | Cary Clark <cary@android.com> | 2010-04-22 13:24:19 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-04-22 13:24:19 -0700 |
| commit | 68b8e349574b5d6db35108cbb5236133b99eeaa6 (patch) | |
| tree | 7c08fce0e3ae0295ddde48b7ce578025db7f52d1 /WebKit/android/nav/CachedFrame.cpp | |
| parent | 3c27e79b9a94ccd27938cffbf5abcef20f5716f5 (diff) | |
| parent | 0f92e845ed6499088958acf229f196ad67965f63 (diff) | |
| download | external_webkit-68b8e349574b5d6db35108cbb5236133b99eeaa6.zip external_webkit-68b8e349574b5d6db35108cbb5236133b99eeaa6.tar.gz external_webkit-68b8e349574b5d6db35108cbb5236133b99eeaa6.tar.bz2 | |
am 0f92e845: am 55ab51c0: Merge "nextTextField may walk off the end or try invalid frames" into froyo
Merge commit '0f92e845ed6499088958acf229f196ad67965f63' into kraken
* commit '0f92e845ed6499088958acf229f196ad67965f63':
nextTextField may walk off the end or try invalid frames
Diffstat (limited to 'WebKit/android/nav/CachedFrame.cpp')
| -rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 21a4115..ce5600b 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -928,28 +928,27 @@ int CachedFrame::maxWorkingVertical() const } const CachedNode* CachedFrame::nextTextField(const CachedNode* start, - const CachedFrame** framePtr) const + const CachedFrame** framePtr, bool* startFound) 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)); + const CachedNode* test = mCachedNodes.begin(); + while ((test = test->traverseNextNode())) { + const CachedFrame* frame = hasFrame(test); if (frame) { + if (!frame->validDocument()) + continue; const CachedNode* node - = frame->nextTextField(0, framePtr); + = frame->nextTextField(start, framePtr, startFound); if (node) return node; } else if (test->isTextInput()) { - if (framePtr) - *framePtr = this; - return test; + if (test == start) + *startFound = true; + else if (*startFound) { + if (framePtr) + *framePtr = this; + return test; + } } - test++; } return 0; } |
