Title: [182910] trunk/Source/WebCore
Revision
182910
Author
timothy_hor...@apple.com
Date
2015-04-16 14:24:23 -0700 (Thu, 16 Apr 2015)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (182909 => 182910)


--- trunk/Source/WebCore/ChangeLog	2015-04-16 20:54:31 UTC (rev 182909)
+++ trunk/Source/WebCore/ChangeLog	2015-04-16 21:24:23 UTC (rev 182910)
@@ -1,3 +1,23 @@
+2015-04-16  Tim Horton  <timothy_hor...@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  <cdu...@apple.com>
 
         Regression(r182517): WebSocket::suspend() causes error event to be fired

Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (182909 => 182910)


--- trunk/Source/WebCore/page/ViewportConfiguration.cpp	2015-04-16 20:54:31 UTC (rev 182909)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp	2015-04-16 21:24:23 UTC (rev 182910)
@@ -119,7 +119,7 @@
         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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to