diff options
-rw-r--r-- | WebCore/platform/android/ScrollViewAndroid.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp index 5622d8b..bce09cf 100644 --- a/WebCore/platform/android/ScrollViewAndroid.cpp +++ b/WebCore/platform/android/ScrollViewAndroid.cpp @@ -28,6 +28,7 @@ #include "ScrollView.h" #include "FloatRect.h" +#include "Frame.h" #include "FrameView.h" #include "IntRect.h" #include "WebCoreFrameBridge.h" @@ -67,9 +68,13 @@ IntSize ScrollView::platformContentsSize() const void ScrollView::platformSetScrollPosition(const WebCore::IntPoint& pt) { - if (parent()) // don't attempt to scroll subframes; they're fully visible + android::WebViewCore* webviewCore = android::WebViewCore::getWebViewCore(this); + // don't attempt to scroll subframes; they're fully visible. + // as this can be called before the view is added to the parent in iframe + // creation, we can't depend on parent() checking. + if (webviewCore->mainFrame()->view() != this) return; - android::WebViewCore::getWebViewCore(this)->scrollTo(pt.x(), pt.y()); + webviewCore->scrollTo(pt.x(), pt.y()); } void ScrollView::platformScrollbarModes(ScrollbarMode& h, ScrollbarMode& v) const |