Title: [121355] trunk/Source/WebKit/blackberry
Revision
121355
Author
[email protected]
Date
2012-06-27 11:44:52 -0700 (Wed, 27 Jun 2012)

Log Message

Scale was incorrect when reloading a simple web page after initial load https://bugs.webkit.org/show_bug.cgi?id=88889

Reviewed by Antonio Gomes.
Patch by Jacky Jiang <[email protected]>

PR: 164442
For FrameLoadTypeStandard load, the layout timer can be fired which can
call dispatchDidFirstVisuallyNonEmptyLayout() after the load Finished
state, in which case the web page will have no chance to zoom to
initial scale. We should give it a chance as well as FrameLoadTypeSame
load.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (121354 => 121355)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-27 18:28:52 UTC (rev 121354)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-27 18:44:52 UTC (rev 121355)
@@ -1638,12 +1638,13 @@
 
 bool WebPagePrivate::shouldZoomToInitialScaleOnLoad() const
 {
-    // For FrameLoadTypeSame load, the first layout timer can be fired after the load Finished state. We should
-    // zoom to initial scale for this case as well, otherwise the scale of the web page can be incorrect.
+    // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call dispatchDidFirstVisuallyNonEmptyLayout()
+    // after the load Finished state, in which case the web page will have no chance to zoom to initial scale. So we should give it a chance,
+    // otherwise the scale of the web page can be incorrect.
     FrameLoadType frameLoadType = FrameLoadTypeStandard;
     if (m_mainFrame && m_mainFrame->loader())
         frameLoadType = m_mainFrame->loader()->loadType();
-    if (m_loadState == Committed || (m_loadState == Finished && frameLoadType == FrameLoadTypeSame))
+    if (m_loadState == Committed || (m_loadState == Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)))
         return true;
     return false;
 }

Modified: trunk/Source/WebKit/blackberry/ChangeLog (121354 => 121355)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-06-27 18:28:52 UTC (rev 121354)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-06-27 18:44:52 UTC (rev 121355)
@@ -1,3 +1,20 @@
+2012-06-27  Jacky Jiang  <[email protected]>
+
+        [BlackBerry] Scale was incorrect when reloading a simple web page after initial load
+        https://bugs.webkit.org/show_bug.cgi?id=88889
+
+        Reviewed by Antonio Gomes.
+
+        PR: 164442
+        For FrameLoadTypeStandard load, the layout timer can be fired which can
+        call dispatchDidFirstVisuallyNonEmptyLayout() after the load Finished
+        state, in which case the web page will have no chance to zoom to
+        initial scale. We should give it a chance as well as FrameLoadTypeSame
+        load.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad):
+
 2012-06-26  Mike Fenton  <[email protected]>
 
         [BlackBerry] Add WebPage interface for Async spell check.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to