summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorGrace Kloba <>2009-04-06 10:20:23 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-06 10:20:23 -0700
commit44d3a81ac387ca3c1ebbad279e3b31d7ac961398 (patch)
treefa87a51e81e7160c11c2fbb3faaa75c750d685c6 /WebCore
parentd7c7a8a52ed8411da25f0a50ae4abe2aace9e147 (diff)
downloadexternal_webkit-44d3a81ac387ca3c1ebbad279e3b31d7ac961398.zip
external_webkit-44d3a81ac387ca3c1ebbad279e3b31d7ac961398.tar.gz
external_webkit-44d3a81ac387ca3c1ebbad279e3b31d7ac961398.tar.bz2
AI 144646: Fix #1726127. During history navigation, ScrollView::platformSetScrollPosition() can be called for an iframe in the creation, which is before it is added to the view hierarchy. So we need to check "this" against mainFrame's view to know whether it is the top view instead of checking parent().
BUG=1726127 Automated import of CL 144646
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/platform/android/ScrollViewAndroid.cpp9
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