From 3bd6ae434ca872f56161160f7825f535c2f39b8f Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 29 Nov 2010 16:28:22 -0500 Subject: hit test complete node even if partially visible An older test incorrectly discards nodes if they are partially off the screen. The test was attempting to ignore nodes that were fully invisible, so change the test to do that. bug:3198707 Change-Id: I3cb13de3c86b43d3388849161bdfc44f84d93b3d --- WebKit/android/nav/CachedRoot.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'WebKit') diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 1a31c15..7d5f3d9 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -1112,10 +1112,12 @@ void CachedRoot::calcBitBounds(const IntRect& nodeBounds, IntRect* bitBounds) co IntRect contentBounds = IntRect(0, 0, mPicture->width(), mPicture->height()); IntRect overBounds = nodeBounds; overBounds.inflate(kMargin); - *bitBounds = mScrolledBounds; - bitBounds->unite(mViewBounds); - bitBounds->intersect(contentBounds); + IntRect viewableBounds = mScrolledBounds; + viewableBounds.unite(mViewBounds); + *bitBounds = contentBounds; bitBounds->intersect(overBounds); + if (!bitBounds->intersects(viewableBounds)) + *bitBounds = IntRect(0, 0, 0, 0); DBG_NAV_LOGD("contentBounds=(%d,%d,r=%d,b=%d) overBounds=(%d,%d,r=%d,b=%d)" " mScrolledBounds=(%d,%d,r=%d,b=%d) mViewBounds=(%d,%d,r=%d,b=%d)" " bitBounds=(%d,%d,r=%d,b=%d)", -- cgit v1.1