diff options
author | Patrick Scott <phanna@android.com> | 2009-07-07 11:11:15 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2009-07-07 12:57:20 -0400 |
commit | ab1813217b89b0a85305f1411800a1c7805864b5 (patch) | |
tree | 968d32fe0281df666eb1827b1f7e7082f6bf5f92 | |
parent | d6a22e7b4e17e465d8c28805b578eee1846dc410 (diff) | |
download | external_webkit-ab1813217b89b0a85305f1411800a1c7805864b5.zip external_webkit-ab1813217b89b0a85305f1411800a1c7805864b5.tar.gz external_webkit-ab1813217b89b0a85305f1411800a1c7805864b5.tar.bz2 |
Use fRight and fBottom instead of width() and height().
The methods width() and height() take in to account negative values for fLeft
and fTop. This can cause the width and height to be larger than the visible
rectangle which was causing cnn.com to grow arbitrarily large.
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index f60b6b5..f88b1d2 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -437,7 +437,12 @@ void WebViewCore::recordPictureSet(PictureSet* content) int right = x + owner->width(); int bottom = y + owner->height(); SkIRect frameRect = {x, y, right, bottom}; - if (SkIRect::Intersects(total, frameRect)) + // Ignore a width or height that is smaller than 1. Some iframes + // have small dimensions in order to be hidden. The iframe + // expansion code does not expand in that case so we should ignore + // them here. + if (frameRect.width() > 1 && frameRect.height() > 1 + && SkIRect::Intersects(total, frameRect)) total.join(x, y, right, bottom); } } @@ -446,7 +451,7 @@ void WebViewCore::recordPictureSet(PictureSet* content) // all the content. if (!contentRect.contains(total)) { // Resize the view to change the overflow clip. - view->resize(total.width(), total.height()); + view->resize(total.fRight, total.fBottom); // We have to force a layout in order for the clip to change. m_mainFrame->contentRenderer()->setNeedsLayoutAndPrefWidthsRecalc(); |