diff options
author | Cary Clark <cary@android.com> | 2010-11-24 10:45:12 -0500 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2010-11-24 11:05:28 -0500 |
commit | eecc9eee4d053cf13f84700d37047ede01c88b12 (patch) | |
tree | eefab4bc1b52c8f31cbcc73e6a757271c9ea9274 /WebKit/android/nav/CachedRoot.cpp | |
parent | eabb311cd2b57ff80b4cf632078cf078d789b563 (diff) | |
download | external_webkit-eecc9eee4d053cf13f84700d37047ede01c88b12.zip external_webkit-eecc9eee4d053cf13f84700d37047ede01c88b12.tar.gz external_webkit-eecc9eee4d053cf13f84700d37047ede01c88b12.tar.bz2 |
fix radio, checkbox hit testing
Radio and checkbox input types draw only a bitmap in
their navigation bounds, and require some special treatment.
Never treat them as transparent.
Use the slop box instead of the exact box when detecting
them, since our asset may be larger than the space webkit
provides.
Also, fix a debug test if the layer is null.
bug:3215174
Change-Id: I3b573e3aa215268390db2d58435ac47115804ed7
Diffstat (limited to 'WebKit/android/nav/CachedRoot.cpp')
-rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index a41cfdc..1a31c15 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -717,9 +717,8 @@ public: layers->getBounds().fLeft, layers->getBounds().fTop, layers->getBounds().fRight, layers->getBounds().fBottom); if (collectGlyphs && (layerType == kDrawGlyph_Type - || ((layerType == kDrawRect_Type - || layerType == kDrawBitmap_Type) - && mTextTest.contains(*layers)))) { + || ((layerType == kDrawRect_Type && mTextTest.contains(*layers)) + || (layerType == kDrawBitmap_Type && mTextSlop.contains(*layers))))) { DBG_NAV_LOGD("RingCheck #%d collectOvers", layers - mLayers.begin()); collectOvers = true; clipped->op(*layers, SkRegion::kUnion_Op); @@ -964,9 +963,9 @@ private: mTextSlop.contains(*layers) ? "true" : "false", gb.fLeft, gb.fTop, gb.fRight, gb.fBottom); #endif - if ((layerType == kDrawGlyph_Type && mTextSlop.contains(*layers)) - || ((layerType == kDrawRect_Type - || layerType == kDrawBitmap_Type) + if (((layerType == kDrawGlyph_Type || layerType == kDrawBitmap_Type) + && mTextSlop.contains(*layers)) + || (layerType == kDrawRect_Type && mTextTest.contains(*layers))) { if (!testLayer) testLayer = layers; @@ -1854,7 +1853,8 @@ void CachedRoot::Debug::print() const b->mHistory->mDebug.print(b); DUMP_NAV_LOGD("// int mMaxXScroll=%d, mMaxYScroll=%d;\n", b->mMaxXScroll, b->mMaxYScroll); - CachedLayer::Debug::printRootLayerAndroid(b->mRootLayer); + if (b->mRootLayer) + CachedLayer::Debug::printRootLayerAndroid(b->mRootLayer); #ifdef DUMP_NAV_CACHE_USING_PRINTF if (gNavCacheLogFile) fclose(gNavCacheLogFile); |