diff options
| author | Cary Clark <cary@android.com> | 2010-04-06 13:17:25 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-04-06 13:17:25 -0700 |
| commit | e5b1750d38ff2208c180fe357355bf7e23e1d97d (patch) | |
| tree | 01ae1fd1409f0aaa4cadf43663535e278274feb6 /WebKit | |
| parent | 3dc27326d844c3fb48cdd88fd22b1c85e0abd0c0 (diff) | |
| parent | be312690095b3ccc1f52336b69c11bf42d4eb9e5 (diff) | |
| download | external_webkit-e5b1750d38ff2208c180fe357355bf7e23e1d97d.zip external_webkit-e5b1750d38ff2208c180fe357355bf7e23e1d97d.tar.gz external_webkit-e5b1750d38ff2208c180fe357355bf7e23e1d97d.tar.bz2 | |
Merge "keep frames associated with regular hits and direct hits" into froyo
Diffstat (limited to 'WebKit')
| -rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 8 | ||||
| -rw-r--r-- | WebKit/android/nav/CachedFrame.h | 3 | ||||
| -rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index bd36bfb..21a4115 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -355,6 +355,7 @@ CachedNode* CachedFrame::find(WebCore::Node* node) // !!! probably debugging onl const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, int* best, bool* inside, const CachedNode** directHit, + const CachedFrame** directHitFramePtr, const CachedFrame** framePtr, int* x, int* y, bool checkForHiddenStart) const { @@ -392,7 +393,7 @@ const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, // We have a direct hit. if (*directHit == NULL) { *directHit = test; - *framePtr = this; + *directHitFramePtr = this; *x = center.x(); *y = center.y(); } else { @@ -402,7 +403,7 @@ const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, // This rectangle is inside the other one, so it is // the best one. *directHit = test; - *framePtr = this; + *directHitFramePtr = this; } } } @@ -444,12 +445,13 @@ const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, for (const CachedFrame* frame = mCachedFrames.begin(); frame != mCachedFrames.end(); frame++) { const CachedNode* frameResult = frame->findBestAt(rect, best, inside, - directHit, framePtr, x, y, checkForHiddenStart); + directHit, directHitFramePtr, framePtr, x, y, checkForHiddenStart); if (NULL != frameResult) result = frameResult; } if (NULL != *directHit) { result = *directHit; + *framePtr = *directHitFramePtr; } return result; } diff --git a/WebKit/android/nav/CachedFrame.h b/WebKit/android/nav/CachedFrame.h index f7276c1..ed76583 100644 --- a/WebKit/android/nav/CachedFrame.h +++ b/WebKit/android/nav/CachedFrame.h @@ -92,7 +92,8 @@ public: const CachedNode* document() const { return mCachedNodes.begin(); } bool empty() const { return mCachedNodes.size() < 2; } // must have 1 past doc const CachedNode* findBestAt(const WebCore::IntRect& , int* best, - bool* inside, const CachedNode** , const CachedFrame** , int* x, + bool* inside, const CachedNode** , const CachedFrame** directFrame, + const CachedFrame** resultFrame, int* x, int* y, bool checkForHidden) const; const CachedFrame* findBestFrameAt(int x, int y) const; const CachedNode* findBestHitAt(const WebCore::IntRect& , diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 0941c7c..71c0993 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -780,9 +780,10 @@ const CachedNode* CachedRoot::findAt(const WebCore::IntRect& rect, int best = INT_MAX; bool inside = false; (const_cast<CachedRoot*>(this))->resetClippedOut(); + const CachedFrame* directHitFramePtr; const CachedNode* directHit = NULL; const CachedNode* node = findBestAt(rect, &best, &inside, &directHit, - framePtr, x, y, checkForHidden); + &directHitFramePtr, framePtr, x, y, checkForHidden); DBG_NAV_LOGD("node=%d (%p)", node == NULL ? 0 : node->index(), node == NULL ? NULL : node->nodePointer()); if (node == NULL) { |
