Title: [131923] trunk/Source/WebKit/blackberry
Revision
131923
Author
[email protected]
Date
2012-10-19 11:08:47 -0700 (Fri, 19 Oct 2012)

Log Message

[BlackBerry] Page viewport aspect ratio not kept on navigating back
https://bugs.webkit.org/show_bug.cgi?id=99760

Reviewed by Yong Li.
Patch by Jacky Jiang <[email protected]>.
Internally reviewed by Konrad Piascik.

PR: 222437
This is to fix the second issue on PR222437 that the viewport not kept
when navigating back from google after rotation to bloomberg.
We were trying to restore the history contents size and scale of
bloomberg which has virtual viewport. The scale would be recalculated
based on the new screen size. However, we would still use the current
contents size if it was greater than the history contents size in
FrameView::setContentsSize which made the contents seem to be scaled
too much.
Actually when we relayout the contents after rotation change, the
current contents size which is based on the virtual viewport has taken
the screen size into account. Shrinking the contents size will be
expensive. So we can ignore screen size based scale calculation here.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::restoreViewState):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (131922 => 131923)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-10-19 17:53:05 UTC (rev 131922)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-10-19 18:08:47 UTC (rev 131923)
@@ -1,3 +1,28 @@
+2012-10-19  Jacky Jiang  <[email protected]>
+
+        [BlackBerry] Page viewport aspect ratio not kept on navigating back
+        https://bugs.webkit.org/show_bug.cgi?id=99760
+
+        Reviewed by Yong Li.
+        Internally reviewed by Konrad Piascik
+
+        PR: 222437
+        This is to fix the second issue on PR222437 that the viewport not kept
+        when navigating back from google after rotation to bloomberg.
+        We were trying to restore the history contents size and scale of
+        bloomberg which has virtual viewport. The scale would be recalculated
+        based on the new screen size. However, we would still use the current
+        contents size if it was greater than the history contents size in
+        FrameView::setContentsSize which made the contents seem to be scaled
+        too much.
+        Actually when we relayout the contents after rotation change, the
+        current contents size which is based on the virtual viewport has taken
+        the screen size into account. Shrinking the contents size will be
+        expensive. So we can ignore screen size based scale calculation here.
+
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
+
 2012-10-19  Mike Fenton  <[email protected]>
 
         [BlackBerry] Add input logs to InputHandler::ensureFocusTextElementVisible.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (131922 => 131923)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-10-19 17:53:05 UTC (rev 131922)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-10-19 18:08:47 UTC (rev 131923)
@@ -1097,8 +1097,8 @@
     if (!scrollChanged && !scaleChanged && !reflowChanged && !orientationChanged)
         return;
 
-    // When rotate happens, only zoom when previous page was zoomToFitScale, otherwise keep old scale.
-    if (orientationChanged && viewState.isZoomToFitScale)
+    // When rotate happens, only zoom when previous page was zoomToFitScale and didn't have virtual viewport, otherwise keep old scale.
+    if (orientationChanged && viewState.isZoomToFitScale && !m_webPagePrivate->hasVirtualViewport())
         scale = BlackBerry::Platform::Graphics::Screen::primaryScreen()->width() * scale / static_cast<double>(BlackBerry::Platform::Graphics::Screen::primaryScreen()->height());
 
     // Don't flash checkerboard before WebPagePrivate::restoreHistoryViewState() finished.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to