Title: [125908] trunk/Source/WebKit/blackberry
Revision
125908
Author
[email protected]
Date
2012-08-17 08:55:53 -0700 (Fri, 17 Aug 2012)

Log Message

[BlackBerry] On reload, www.sohu.com renders part white background, part overscroll pattern
https://bugs.webkit.org/show_bug.cgi?id=94348

Reviewed by Yong Li.
Jacky Jiang  <[email protected]>

PR: 179200
This can fix the reload issues of sohu.com, yahoo.com and
thestar.com/iphone(PR158041). And it is also related with PR178305.

Internally reviewed by George Staikos.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setLoadState):  Keeping scales for
reload was doing more harm than good. Two reasons to remove this:
(1) During reload, contents rect is changing due to layout updates,
it is possible that the contents or the white background can't cover
the whole screen if we are using the previous scales.
(2) Before reload, the source of the web page can be changed, therefore
previous scales won't be valid anymore.
Remove shouldRestoreViewState() as this check here is useless now.
(BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad):  During
reload, we should give it a chance to zoom to fit the screen,
otherwise, it happens that the contents can't cover the whole screen
until we restore the view state, see PR158041.
Remove shouldRestoreViewState() as the error page issue PR178305 can be
covered by reload now.
* WebCoreSupport/FrameLoaderClientBlackBerry.h: Remove unused shouldRestoreViewState().

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (125907 => 125908)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-08-17 15:46:04 UTC (rev 125907)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-08-17 15:55:53 UTC (rev 125908)
@@ -1066,17 +1066,11 @@
             // Check if we have already process the meta viewport tag, this only happens on history navigation.
             // For back/forward history navigation, we should only keep these previous values if the document
             // has the meta viewport tag when the state is Committed in setLoadState.
-            // Refreshing should keep these previous values as well.
             static ViewportArguments defaultViewportArguments;
             bool documentHasViewportArguments = false;
-            FrameLoadType frameLoadType = FrameLoadTypeStandard;
             if (m_mainFrame && m_mainFrame->document() && m_mainFrame->document()->viewportArguments() != defaultViewportArguments)
                 documentHasViewportArguments = true;
-            if (m_mainFrame && m_mainFrame->loader())
-                frameLoadType = m_mainFrame->loader()->loadType();
-            FrameLoaderClientBlackBerry* frameLoaderClient = static_cast<FrameLoaderClientBlackBerry*>(m_mainFrame->loader()->client());
-            if (!((m_didRestoreFromPageCache && documentHasViewportArguments)
-                || ((frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin) && frameLoaderClient->shouldRestoreViewState()))) {
+            if (!(m_didRestoreFromPageCache && documentHasViewportArguments)) {
                 m_viewportArguments = ViewportArguments();
                 m_userScalable = m_webSettings->isUserScalable();
                 resetScales();
@@ -1759,11 +1753,9 @@
     bool performedZoom = false;
     bool shouldZoom = !m_userPerformedManualZoom;
 
-    // If this load should restore view state, don't zoom to initial scale
+    // If this is a back/forward type navigation, don't zoom to initial scale
     // but instead let the HistoryItem's saved viewport reign supreme.
-    FrameLoaderClientBlackBerry* frameLoaderClient = static_cast<FrameLoaderClientBlackBerry*>(m_mainFrame->loader()->client());
-    if (m_mainFrame && m_mainFrame->loader() && m_mainFrame->loader()->shouldRestoreScrollPositionAndViewState()
-        && frameLoaderClient && frameLoaderClient->shouldRestoreViewState())
+    if (m_mainFrame && m_mainFrame->loader() && isBackForwardLoadType(m_mainFrame->loader()->loadType()))
         shouldZoom = false;
 
     if (shouldZoom && shouldZoomToInitialScaleOnLoad()) {

Modified: trunk/Source/WebKit/blackberry/ChangeLog (125907 => 125908)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-08-17 15:46:04 UTC (rev 125907)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-08-17 15:55:53 UTC (rev 125908)
@@ -1,3 +1,34 @@
+2012-08-17  Jacky Jiang  <[email protected]>
+
+        [BlackBerry] On reload, www.sohu.com renders part white background, part overscroll pattern
+        https://bugs.webkit.org/show_bug.cgi?id=94348
+
+        Reviewed by Yong Li.
+        Jacky Jiang  <[email protected]>
+
+        PR: 179200
+        This can fix the reload issues of sohu.com, yahoo.com and
+        thestar.com/iphone(PR158041). And it is also related with PR178305.
+
+        Internally reviewed by George Staikos.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::setLoadState):  Keeping scales for
+        reload was doing more harm than good. Two reasons to remove this:
+        (1) During reload, contents rect is changing due to layout updates,
+        it is possible that the contents or the white background can't cover
+        the whole screen if we are using the previous scales.
+        (2) Before reload, the source of the web page can be changed, therefore
+        previous scales won't be valid anymore.
+        Remove shouldRestoreViewState() as this check here is useless now.
+        (BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad):  During
+        reload, we should give it a chance to zoom to fit the screen,
+        otherwise, it happens that the contents can't cover the whole screen
+        until we restore the view state, see PR158041.
+        Remove shouldRestoreViewState() as the error page issue PR178305 can be
+        covered by reload now.
+        * WebCoreSupport/FrameLoaderClientBlackBerry.h: Remove unused shouldRestoreViewState().
+
 2012-08-16  Mike Fenton  <[email protected]>
 
         [BlackBerry] Use form state to determine the VKB enter key.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h (125907 => 125908)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h	2012-08-17 15:46:04 UTC (rev 125907)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h	2012-08-17 15:55:53 UTC (rev 125908)
@@ -182,8 +182,6 @@
 
     void suppressChildFrameCreation() { m_childFrameCreationSuppressed = true; }
 
-    bool shouldRestoreViewState() const { return m_shouldRestoreViewState; }
-
 private:
     void receivedData(const char*, int, const String&);
     void didFinishOrFailLoading(const ResourceError&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to