From cd6b6d96802a7827fce97f7ae7efac07c0a5e798 Mon Sep 17 00:00:00 2001 From: "Shimeng (Simon) Wang" Date: Fri, 17 Jun 2011 10:42:40 -0700 Subject: Ignore the initial empty document when setting viewport size. This fixes the issue where "google legal" dialog will show empty content, since the initial empty document will get laid out and used in some circumstances. issue: 4501857 Change-Id: I779d983f3c81724663391872de81ceed025adec1 --- Source/WebKit/android/jni/WebViewCore.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 4e20ca1..96045c6 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -1251,6 +1251,11 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height, int textWrapWidth, float scale, int screenWidth, int screenHeight, int anchorX, int anchorY, bool ignoreHeight) { + // Ignore the initial empty document. + const WebCore::KURL& url = m_mainFrame->document()->url(); + if (url.isEmpty()) + return; + WebCoreViewBridge* window = m_mainFrame->view()->platformWidget(); int ow = window->width(); int oh = window->height(); -- cgit v1.1