diff options
| author | Grace Kloba <klobag@google.com> | 2010-01-15 14:30:59 -0800 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2010-01-18 15:20:24 -0800 |
| commit | b99dd716b4af0afde074e28b50b7b28ae3c03da7 (patch) | |
| tree | d64bef1cc96a06f24b513bea8c55fac5a854fc80 | |
| parent | e32bb87640c16f2414a3f35cefd3c4146a174091 (diff) | |
| download | external_webkit-b99dd716b4af0afde074e28b50b7b28ae3c03da7.zip external_webkit-b99dd716b4af0afde074e28b50b7b28ae3c03da7.tar.gz external_webkit-b99dd716b4af0afde074e28b50b7b28ae3c03da7.tar.bz2 | |
DO NOT MERGE
When the hit result node has zero width, we can't
use it. Try its parents.
This happens in the story inside nytimes.com. They
use a special <nyt_text> tag. If it is the hit point,
it has 0 width and height.
Fix http://b/issue?id=2363260
| -rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index d13abe5..6ebf1df 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1092,6 +1092,14 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height, bounds = node->getRect(); DBG_NAV_LOGD("ob:(x=%d,y=%d,w=%d,h=%d)", bounds.x(), bounds.y(), bounds.width(), bounds.height()); + // sites like nytimes.com insert a non-standard tag <nyt_text> + // in the html. If it is the HitTestResult, it may have zero + // width and height. In this case, use its parent node. + if (bounds.width() == 0) { + node = node->parent(); + if (node) + bounds = node->getRect(); + } if ((anchorX | anchorY) == 0) { WebCore::IntPoint offset = WebCore::IntPoint( anchorPoint.x() - bounds.x(), anchorPoint.y() |
