2011-01-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Jan 2011 14:43:02 +0000 (14:43 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Jan 2011 14:43:02 +0000 (14:43 +0000)
        Reviewed by Andreas Kling.

        Viewport meta: Always adjust device dimensions to the device pixel ratio.

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

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

Source/WebCore/ChangeLog
Source/WebCore/dom/ViewportArguments.cpp

index d721157..ef4d26f 100644 (file)
@@ -1,3 +1,12 @@
+2011-01-23  Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        Viewport meta: Always adjust device dimensions to the device pixel ratio.
+
+        * dom/ViewportArguments.cpp:
+        (WebCore::computeViewportAttributes):
+
 2011-01-23  Andreas Kling  <kling@webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
index 5ac1a26..6dd1b8a 100644 (file)
@@ -50,30 +50,6 @@ ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktop
 
     ASSERT(availableWidth > 0 && availableHeight > 0);
 
-    switch (int(args.width)) {
-    case ViewportArguments::ValueDesktopWidth:
-        args.width = desktopWidth;
-        break;
-    case ViewportArguments::ValueDeviceWidth:
-        args.width = deviceWidth;
-        break;
-    case ViewportArguments::ValueDeviceHeight:
-        args.width = deviceHeight;
-        break;
-    }
-
-    switch (int(args.height)) {
-    case ViewportArguments::ValueDesktopWidth:
-        args.height = desktopWidth;
-        break;
-    case ViewportArguments::ValueDeviceWidth:
-        args.height = deviceWidth;
-        break;
-    case ViewportArguments::ValueDeviceHeight:
-        args.height = deviceHeight;
-        break;
-    }
-
     switch (int(args.targetDensityDpi)) {
     case ViewportArguments::ValueDeviceDPI:
         args.targetDensityDpi = deviceDPI;
@@ -100,6 +76,30 @@ ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktop
         deviceHeight /= result.devicePixelRatio;
     }
 
+    switch (int(args.width)) {
+    case ViewportArguments::ValueDesktopWidth:
+        args.width = desktopWidth;
+        break;
+    case ViewportArguments::ValueDeviceWidth:
+        args.width = deviceWidth;
+        break;
+    case ViewportArguments::ValueDeviceHeight:
+        args.width = deviceHeight;
+        break;
+    }
+
+    switch (int(args.height)) {
+    case ViewportArguments::ValueDesktopWidth:
+        args.height = desktopWidth;
+        break;
+    case ViewportArguments::ValueDeviceWidth:
+        args.height = deviceWidth;
+        break;
+    case ViewportArguments::ValueDeviceHeight:
+        args.height = deviceHeight;
+        break;
+    }
+
     // Clamp values to range defined by spec and resolve minimum-scale and maximum-scale values
     if (args.width != ViewportArguments::ValueAuto)
         args.width = min(float(10000), max(args.width, float(1)));