Title: [120124] trunk/Source/WebKit/blackberry
- Revision
- 120124
- Author
- [email protected]
- Date
- 2012-06-12 14:44:54 -0700 (Tue, 12 Jun 2012)
Log Message
[BlackBerry] Scale was incorrect when reloading a simple web page after initial load
https://bugs.webkit.org/show_bug.cgi?id=88889
Reviewed by Adam Treat.
Patch by Jacky Jiang <[email protected]>
PR: 164442
When we were reloading a web page with the load type FrameLoadTypeSame
after the initial load, the first layout timer was fired after the load
Finished state, in which case the web page would have no chance to zoom
to the initial scale during the layout as it was only for load
Committed state. This patch takes care of it.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::layoutFinished):
(BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad):
(WebKit):
(BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidFirstVisuallyNonEmptyLayout):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (120123 => 120124)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-06-12 21:40:42 UTC (rev 120123)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-06-12 21:44:54 UTC (rev 120124)
@@ -1554,7 +1554,7 @@
m_nestedLayoutFinishedCount++;
- if (loadState() == Committed)
+ if (shouldZoomToInitialScaleOnLoad())
zoomToInitialScaleOnLoad();
else if (loadState() != None)
notifyTransformedContentsSizeChanged();
@@ -1591,6 +1591,18 @@
}
}
+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.
+ FrameLoadType frameLoadType = FrameLoadTypeStandard;
+ if (m_mainFrame && m_mainFrame->loader())
+ frameLoadType = m_mainFrame->loader()->loadType();
+ if (m_loadState == Committed || (m_loadState == Finished && frameLoadType == FrameLoadTypeSame))
+ return true;
+ return false;
+}
+
void WebPagePrivate::zoomToInitialScaleOnLoad()
{
#if DEBUG_WEBPAGE_LOAD
@@ -1628,7 +1640,7 @@
if (m_mainFrame && m_mainFrame->loader() && m_mainFrame->loader()->shouldRestoreScrollPositionAndViewState())
shouldZoom = false;
- if (shouldZoom && loadState() == Committed) {
+ if (shouldZoom && shouldZoomToInitialScaleOnLoad()) {
// Preserve at top and at left position, to avoid scrolling
// to a non top-left position for web page with viewport meta tag
// that specifies an initial-scale that is zoomed in.
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (120123 => 120124)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-06-12 21:40:42 UTC (rev 120123)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-06-12 21:44:54 UTC (rev 120124)
@@ -204,6 +204,7 @@
void notifyPopupAutofillDialog(const Vector<String>&, const WebCore::IntRect&);
void notifyDismissAutofillDialog();
+ bool shouldZoomToInitialScaleOnLoad() const;
// Called according to our heuristic or from setLoadState depending on whether we have a virtual viewport.
void zoomToInitialScaleOnLoad();
Modified: trunk/Source/WebKit/blackberry/ChangeLog (120123 => 120124)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-06-12 21:40:42 UTC (rev 120123)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-06-12 21:44:54 UTC (rev 120124)
@@ -1,3 +1,28 @@
+2012-06-12 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 Adam Treat.
+ Patch by Jacky Jiang <[email protected]>
+
+ PR: 164442
+ When we were reloading a web page with the load type FrameLoadTypeSame
+ after the initial load, the first layout timer was fired after the load
+ Finished state, in which case the web page would have no chance to zoom
+ to the initial scale during the layout as it was only for load
+ Committed state. This patch takes care of it.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::layoutFinished):
+ (BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad):
+ (WebKit):
+ (BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDidFirstVisuallyNonEmptyLayout):
+
2012-06-12 Crystal Zhang <[email protected]>
[BlackBerry] Fix crash in InputHandler
Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (120123 => 120124)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp 2012-06-12 21:40:42 UTC (rev 120123)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp 2012-06-12 21:44:54 UTC (rev 120124)
@@ -824,10 +824,7 @@
readyToRender(true);
- // FIXME: We shouldn't be getting here if we are not in the Committed state but we are
- // so we can not assert on that right now. But we only want to do this on load.
- // RIM Bug #555
- if (m_webPagePrivate->loadState() == WebPagePrivate::Committed) {
+ if (m_webPagePrivate->shouldZoomToInitialScaleOnLoad()) {
m_webPagePrivate->zoomToInitialScaleOnLoad(); // Set the proper zoom level first.
m_webPagePrivate->m_backingStore->d->clearVisibleZoom(); // Clear the visible zoom since we're explicitly rendering+blitting below.
m_webPagePrivate->m_backingStore->d->renderVisibleContents();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes