Title: [184704] branches/safari-601.1.32.2-branch/Source

Diff

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog (184703 => 184704)


--- branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog	2015-05-21 05:55:21 UTC (rev 184703)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog	2015-05-21 06:39:27 UTC (rev 184704)
@@ -1,3 +1,23 @@
+2015-05-20  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r184681. rdar://problem/20924495
+
+    2015-05-20  Enrica Casucci  <enr...@apple.com>
+
+            [iOS] Using CSS viewport units causes incorrect layout.
+            https://bugs.webkit.org/show_bug.cgi?id=145225
+            rdar://problem/20924495
+
+            Reviewed by Benjamin Poulain.
+
+            * page/ViewportConfiguration.cpp:
+            (WebCore::ViewportConfiguration::initialScaleFromSize):
+            (WebCore::ViewportConfiguration::initialScale):
+            (WebCore::ViewportConfiguration::initialScaleIgnoringContentSize):
+            * page/ViewportConfiguration.h:
+            (WebCore::ViewportConfiguration::initialScaleFromSize):
+            (WebCore::ViewportConfiguration::initialScaleIgnoringContentSize):
+
 2015-05-20  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r184611.

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.cpp (184703 => 184704)


--- branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.cpp	2015-05-21 05:55:21 UTC (rev 184703)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.cpp	2015-05-21 06:39:27 UTC (rev 184704)
@@ -130,30 +130,38 @@
     return shouldIgnoreHorizontalScalingConstraints() || shouldIgnoreVerticalScalingConstraints();
 }
 
-double ViewportConfiguration::initialScale() const
+double ViewportConfiguration::initialScaleFromSize(double width, double height, bool shouldIgnoreScalingConstraints) const
 {
     ASSERT(!constraintsAreAllRelative(m_configuration));
 
     // If the document has specified its own initial scale, use it regardless.
     // This is guaranteed to be sanity checked already, so no need for MIN/MAX.
-    if (m_configuration.initialScaleIsSet && !shouldIgnoreScalingConstraints())
+    if (m_configuration.initialScaleIsSet && !shouldIgnoreScalingConstraints)
         return m_configuration.initialScale;
 
     // If not, it is up to us to determine the initial scale.
     // We want a scale small enough to fit the document width-wise.
     const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
-    double width = m_contentSize.width() > 0 ? m_contentSize.width() : layoutWidth();
     double initialScale = 0;
     if (width > 0 && !shouldIgnoreVerticalScalingConstraints())
         initialScale = minimumLayoutSize.width() / width;
 
     // Prevent the initial scale from shrinking to a height smaller than our view's minimum height.
-    double height = m_contentSize.height() > 0 ? m_contentSize.height() : layoutHeight();
     if (height > 0 && height * initialScale < minimumLayoutSize.height() && !shouldIgnoreHorizontalScalingConstraints())
         initialScale = minimumLayoutSize.height() / height;
-    return std::min(std::max(initialScale, shouldIgnoreScalingConstraints() ? m_defaultConfiguration.minimumScale : m_configuration.minimumScale), m_configuration.maximumScale);
+    return std::min(std::max(initialScale, shouldIgnoreScalingConstraints ? m_defaultConfiguration.minimumScale : m_configuration.minimumScale), m_configuration.maximumScale);
 }
 
+double ViewportConfiguration::initialScale() const
+{
+    return initialScaleFromSize(m_contentSize.width() > 0 ? m_contentSize.width() : layoutWidth(), m_contentSize.height() > 0 ? m_contentSize.height() : layoutHeight(), shouldIgnoreScalingConstraints());
+}
+
+double ViewportConfiguration::initialScaleIgnoringContentSize() const
+{
+    return initialScaleFromSize(layoutWidth(), layoutHeight(), false);
+}
+
 double ViewportConfiguration::minimumScale() const
 {
     // If we scale to fit, then this is our minimum scale as well.

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.h (184703 => 184704)


--- branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.h	2015-05-21 05:55:21 UTC (rev 184703)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/page/ViewportConfiguration.h	2015-05-21 06:39:27 UTC (rev 184704)
@@ -82,6 +82,7 @@
 
     WEBCORE_EXPORT IntSize layoutSize() const;
     WEBCORE_EXPORT double initialScale() const;
+    WEBCORE_EXPORT double initialScaleIgnoringContentSize() const;
     WEBCORE_EXPORT double minimumScale() const;
     double maximumScale() const { return m_configuration.maximumScale; }
     WEBCORE_EXPORT bool allowsUserScaling() const;
@@ -100,6 +101,7 @@
 private:
     void updateConfiguration();
     double viewportArgumentsLength(double length) const;
+    double initialScaleFromSize(double width, double height, bool shouldIgnoreScalingConstraints) const;
     int layoutWidth() const;
     int layoutHeight() const;
 

Modified: branches/safari-601.1.32.2-branch/Source/WebKit2/ChangeLog (184703 => 184704)


--- branches/safari-601.1.32.2-branch/Source/WebKit2/ChangeLog	2015-05-21 05:55:21 UTC (rev 184703)
+++ branches/safari-601.1.32.2-branch/Source/WebKit2/ChangeLog	2015-05-21 06:39:27 UTC (rev 184704)
@@ -1,3 +1,18 @@
+2015-05-20  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r184681. rdar://problem/20924495
+
+    2015-05-20  Enrica Casucci  <enr...@apple.com>
+
+            [iOS] Using CSS viewport units causes incorrect layout.
+            https://bugs.webkit.org/show_bug.cgi?id=145225
+            rdar://problem/20924495
+
+            Reviewed by Benjamin Poulain.
+
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
+
 2015-05-20  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r184596.

Modified: branches/safari-601.1.32.2-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (184703 => 184704)


--- branches/safari-601.1.32.2-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-05-21 05:55:21 UTC (rev 184703)
+++ branches/safari-601.1.32.2-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-05-21 06:39:27 UTC (rev 184704)
@@ -2710,7 +2710,7 @@
         largestUnobscuredRect = m_viewportConfiguration.minimumLayoutSize();
 
     FrameView& frameView = *mainFrameView();
-    largestUnobscuredRect.scale(1 / m_viewportConfiguration.initialScale());
+    largestUnobscuredRect.scale(1 / m_viewportConfiguration.initialScaleIgnoringContentSize());
     frameView.setViewportSizeForCSSViewportUnits(roundedIntSize(largestUnobscuredRect));
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to