Title: [134801] trunk/Source
Revision
134801
Author
[email protected]
Date
2012-11-15 11:06:03 -0800 (Thu, 15 Nov 2012)

Log Message

Remove initiallyFitToViewport attribute
https://bugs.webkit.org/show_bug.cgi?id=102392

Reviewed by Noam Rosenthal.

Remove the initiallyFitToViewport which shouldn't have been
added in the first place. We now reset userScalable to auto (-1)
in case it was not explicitly set by the web author.

Same behavior, covered by existing tests.

Source/WebCore:

* dom/ViewportArguments.cpp:
(WebCore::ViewportArguments::resolve):
* dom/ViewportArguments.h:
(ViewportAttributes):

Source/WebKit2:

* UIProcess/PageViewportController.cpp:
(WebKit::PageViewportController::PageViewportController):
(WebKit::PageViewportController::pageTransitionViewportReady):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134800 => 134801)


--- trunk/Source/WebCore/ChangeLog	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebCore/ChangeLog	2012-11-15 19:06:03 UTC (rev 134801)
@@ -1,3 +1,21 @@
+2012-11-15  Kenneth Rohde Christiansen  <[email protected]>
+
+        Remove initiallyFitToViewport attribute
+        https://bugs.webkit.org/show_bug.cgi?id=102392
+
+        Reviewed by Noam Rosenthal.
+
+        Remove the initiallyFitToViewport which shouldn't have been
+        added in the first place. We now reset userScalable to auto (-1)
+        in case it was not explicitly set by the web author.
+
+        Same behavior, covered by existing tests.
+
+        * dom/ViewportArguments.cpp:
+        (WebCore::ViewportArguments::resolve):
+        * dom/ViewportArguments.h:
+        (ViewportAttributes):
+
 2012-11-15  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Update RTCPeerConnection states to match the latest editors draft

Modified: trunk/Source/WebCore/dom/ViewportArguments.cpp (134800 => 134801)


--- trunk/Source/WebCore/dom/ViewportArguments.cpp	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebCore/dom/ViewportArguments.cpp	2012-11-15 19:06:03 UTC (rev 134801)
@@ -74,8 +74,6 @@
     float resultMaxZoom = maxZoom;
     float resultUserZoom = userZoom;
 
-    bool resultAutoFit = resultZoom == ViewportArguments::ValueAuto;
-
     switch (int(resultWidth)) {
     case ViewportArguments::ValueDeviceWidth:
         resultWidth = deviceSize.width();
@@ -102,7 +100,6 @@
     resultMaxZoom = clampScaleValue(resultMaxZoom);
 
     ViewportAttributes result;
-    result.initiallyFitToViewport = resultAutoFit;
 
     // Resolve minimum-scale and maximum-scale values according to spec.
     if (resultMinZoom == ViewportArguments::ValueAuto)
@@ -152,7 +149,7 @@
     result.layoutSize.setWidth(resultWidth);
     result.layoutSize.setHeight(resultHeight);
 
-    // FIXME: Remove initiallyFitToViewport and use the below.
+    // FIXME: This might affect some ports, but is the right thing to do.
     // Only set initialScale to a value if it was explicitly set.
     // if (resultZoom == ViewportArguments::ValueAuto)
     //    result.initialScale = ViewportArguments::ValueAuto;

Modified: trunk/Source/WebCore/dom/ViewportArguments.h (134800 => 134801)


--- trunk/Source/WebCore/dom/ViewportArguments.h	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebCore/dom/ViewportArguments.h	2012-11-15 19:06:03 UTC (rev 134801)
@@ -50,7 +50,6 @@
     float maximumScale;
 
     float userScalable;
-    bool initiallyFitToViewport;
 };
 
 struct ViewportArguments {

Modified: trunk/Source/WebKit2/ChangeLog (134800 => 134801)


--- trunk/Source/WebKit2/ChangeLog	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-15 19:06:03 UTC (rev 134801)
@@ -1,3 +1,22 @@
+2012-11-15  Kenneth Rohde Christiansen  <[email protected]>
+
+        Remove initiallyFitToViewport attribute
+        https://bugs.webkit.org/show_bug.cgi?id=102392
+
+        Reviewed by Noam Rosenthal.
+
+        Remove the initiallyFitToViewport which shouldn't have been
+        added in the first place. We now reset userScalable to auto (-1)
+        in case it was not explicitly set by the web author.
+
+        Same behavior, covered by existing tests.
+
+        * UIProcess/PageViewportController.cpp:
+        (WebKit::PageViewportController::PageViewportController):
+        (WebKit::PageViewportController::pageTransitionViewportReady):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::sendViewportAttributesChanged):
+
 2012-11-15  Balazs Kelemen  <[email protected]>
 
         Coordinated Graphics: support the "freeze animations" API

Modified: trunk/Source/WebKit2/UIProcess/PageViewportController.cpp (134800 => 134801)


--- trunk/Source/WebKit2/UIProcess/PageViewportController.cpp	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebKit2/UIProcess/PageViewportController.cpp	2012-11-15 19:06:03 UTC (rev 134801)
@@ -56,7 +56,6 @@
     m_rawAttributes.minimumScale = 1;
     m_rawAttributes.maximumScale = 1;
     m_rawAttributes.userScalable = m_allowsUserScaling;
-    m_rawAttributes.initiallyFitToViewport = true;
 
     ASSERT(m_client);
     m_client->setController(this);
@@ -145,7 +144,7 @@
 {
     if (!m_rawAttributes.layoutSize.isEmpty()) {
         m_hadUserInteraction = false;
-        float initialScale = m_rawAttributes.initiallyFitToViewport ? m_minimumScaleToFit : m_rawAttributes.initialScale;
+        float initialScale = (m_rawAttributes.initialScale < 0) ? m_minimumScaleToFit : m_rawAttributes.initialScale;
         applyScaleAfterRenderingContents(innerBoundedViewportScale(toViewportScale(initialScale)));
     }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (134800 => 134801)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-15 19:01:40 UTC (rev 134800)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-15 19:06:03 UTC (rev 134801)
@@ -1021,6 +1021,7 @@
     int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height();
 
     ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), m_viewportSize);
+    attr.initialScale = m_page->viewportArguments().zoom; // Resets auto (-1) if no value was set by user.
 
     // This also takes care of the relayout.
     setFixedLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to