Sites with both width=device-width and height=device-height load zoomed out
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Apr 2015 21:24:23 +0000 (21:24 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Apr 2015 21:24:23 +0000 (21:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143795
<rdar://problem/20369671>

Reviewed by Ben Poulain.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
Some sites specify both width=device-width and height=device-height, and
then lay out to device width but with a large amount of vertically scrollable content
(so, height=device-height was a lie).

In all other cases where we use device-width and device-height, we prefer
width=device-width over height=device-height, but in the code to ignore scaling constraints,
the two paths were completely separate. On sites that specify both, this
resulted in us attempting to zoom out to fit the entire height of the very tall page,
which isn't at all what we wanted. So, ignore height=device-height if a width is specified.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182910 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/ViewportConfiguration.cpp

index a41d7bc2f45d18a94bf22e3d4e8b37da2e0e236c..228c95dc9666a2452571680e0a2dd59f8c1b23d1 100644 (file)
@@ -1,3 +1,23 @@
+2015-04-16  Tim Horton  <timothy_horton@apple.com>
+
+        Sites with both width=device-width and height=device-height load zoomed out
+        https://bugs.webkit.org/show_bug.cgi?id=143795
+        <rdar://problem/20369671>
+
+        Reviewed by Ben Poulain.
+
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
+        Some sites specify both width=device-width and height=device-height, and
+        then lay out to device width but with a large amount of vertically scrollable content
+        (so, height=device-height was a lie).
+
+        In all other cases where we use device-width and device-height, we prefer
+        width=device-width over height=device-height, but in the code to ignore scaling constraints,
+        the two paths were completely separate. On sites that specify both, this
+        resulted in us attempting to zoom out to fit the entire height of the very tall page,
+        which isn't at all what we wanted. So, ignore height=device-height if a width is specified.
+
 2015-04-16  Chris Dumez  <cdumez@apple.com>
 
         Regression(r182517): WebSocket::suspend() causes error event to be fired
index af142c03c48437efbff932bb8da53094091ac615..0a33dd8b06b6e02a093d06687f7d14c953d44ea5 100644 (file)
@@ -119,7 +119,7 @@ bool ViewportConfiguration::shouldIgnoreVerticalScalingConstraints() const
         return false;
 
     bool laidOutTallerThanViewport = m_contentSize.height() > layoutHeight();
-    if (m_viewportArguments.height == ViewportArguments::ValueDeviceHeight)
+    if (m_viewportArguments.height == ViewportArguments::ValueDeviceHeight && m_viewportArguments.width == ViewportArguments::ValueAuto)
         return laidOutTallerThanViewport;
 
     return false;