Title: [169570] trunk/Source/WebCore
Revision
169570
Author
benja...@webkit.org
Date
2014-06-03 14:31:26 -0700 (Tue, 03 Jun 2014)

Log Message

[iOS] Start ignoring common bogus viewport parameters
https://bugs.webkit.org/show_bug.cgi?id=133466
<rdar://problem/16203396>

Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-06-03
Reviewed by Sam Weinig.

Incorrect viewports are spreading really quickly lately. We have to start ignoring
some combinations of arguments as they are almost always used incorrectly, causing
a poor user experience on those websites.

* dom/ViewportArguments.cpp:
(WebCore::finalizeViewportArguments):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169569 => 169570)


--- trunk/Source/WebCore/ChangeLog	2014-06-03 21:26:50 UTC (rev 169569)
+++ trunk/Source/WebCore/ChangeLog	2014-06-03 21:31:26 UTC (rev 169570)
@@ -1,3 +1,18 @@
+2014-06-03  Benjamin Poulain  <bpoul...@apple.com>
+
+        [iOS] Start ignoring common bogus viewport parameters
+        https://bugs.webkit.org/show_bug.cgi?id=133466
+        <rdar://problem/16203396>
+
+        Reviewed by Sam Weinig.
+
+        Incorrect viewports are spreading really quickly lately. We have to start ignoring
+        some combinations of arguments as they are almost always used incorrectly, causing
+        a poor user experience on those websites.
+
+        * dom/ViewportArguments.cpp:
+        (WebCore::finalizeViewportArguments):
+
 2014-06-03  Yusuke Suzuki  <utatane....@gmail.com>
 
         CSS JIT: add support for the "any" pseudo class

Modified: trunk/Source/WebCore/dom/ViewportArguments.cpp (169569 => 169570)


--- trunk/Source/WebCore/dom/ViewportArguments.cpp	2014-06-03 21:26:50 UTC (rev 169569)
+++ trunk/Source/WebCore/dom/ViewportArguments.cpp	2014-06-03 21:31:26 UTC (rev 169570)
@@ -404,7 +404,12 @@
 #if PLATFORM(IOS)
 void finalizeViewportArguments(ViewportArguments& arguments, const FloatSize& screenSize)
 {
-    if (arguments.width == ViewportArguments::ValueDeviceWidth)
+    if (arguments.width == ViewportArguments::ValueDeviceWidth && (arguments.zoom == 1 || arguments.minZoom == 1)) {
+        // A large amount of pages are using the viewport width=device-width + scaling parameters incorrectly.
+        // This has become so pervasive that the vast majority of those pages render better without viewport meta tag than with it.
+        // Clearing the width is a workaround for the most common incorrect viewports. :(
+        arguments.width = ViewportArguments::ValueAuto;
+    } else if (arguments.width == ViewportArguments::ValueDeviceWidth)
         arguments.width = screenSize.width();
     else if (arguments.width == ViewportArguments::ValueDeviceHeight)
         arguments.width = screenSize.height();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to