summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-06-03 09:47:19 -0700
committerGrace Kloba <klobag@google.com>2010-06-03 13:42:11 -0700
commit914d19a9c9c51a1d5cfe0cec29aeb9adaf9357d5 (patch)
tree829890c94db83e46b7df7274bf2af1a9ed2f3d4b /WebCore/platform
parent21d5fcfd0da21851464111d2aa0902b2b6edbb02 (diff)
downloadexternal_webkit-914d19a9c9c51a1d5cfe0cec29aeb9adaf9357d5.zip
external_webkit-914d19a9c9c51a1d5cfe0cec29aeb9adaf9357d5.tar.gz
external_webkit-914d19a9c9c51a1d5cfe0cec29aeb9adaf9357d5.tar.bz2
Fix platformVisibleContentRect() for the sub frame.
The visibleBounds is only set to the top frame. For sub frame, we need to intersect it with the sub frame's own bounds. Fix http://b/issue?id=2685194
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/android/ScrollViewAndroid.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp
index ccfe10e..74f9d6b 100644
--- a/WebCore/platform/android/ScrollViewAndroid.cpp
+++ b/WebCore/platform/android/ScrollViewAndroid.cpp
@@ -54,11 +54,21 @@ namespace WebCore {
IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
{
- IntRect rect = platformWidget()->getVisibleBounds();
- // This makes subframes draw correctly, since subframes cannot scroll.
- if (parent())
- return IntRect(0, 0, rect.width(), rect.height());
- return rect;
+ if (parent()) {
+ const ScrollView* sv = this;
+ int offsetX = 0;
+ int offsetY = 0;
+ while (sv->parent()) {
+ offsetX += sv->x();
+ offsetY += sv->y();
+ sv = sv->parent();
+ }
+ IntRect rect = sv->platformWidget()->getVisibleBounds();
+ rect.move(-offsetX, -offsetY);
+ rect.intersect(IntRect(0, 0, width(), height()));
+ return rect;
+ }
+ return platformWidget()->getVisibleBounds();
}
IntSize ScrollView::platformContentsSize() const