Title: [120317] trunk
Revision
120317
Author
[email protected]
Date
2012-06-14 06:05:00 -0700 (Thu, 14 Jun 2012)

Log Message

Web Inspector: [Device Metrics] "Fit window" results in duplicate rescaling in WebDevToolsAgentImpl::autoZoomPageToFitWidth()
https://bugs.webkit.org/show_bug.cgi?id=89092

Reviewed by Pavel Feldman.

Source/WebKit/chromium:

Do not apply the sizeRatio after it has been applied in scaledEmulatedFrameSize().

* src/WebDevToolsAgentImpl.cpp:
(WebKit::DeviceMetricsSupport::autoZoomPageToFitWidth):
(WebKit::DeviceMetricsSupport::ensureOriginalZoomFactor):

LayoutTests:

* platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt:
* platform/chromium/inspector/styles/device-metrics-fit-window.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (120316 => 120317)


--- trunk/LayoutTests/ChangeLog	2012-06-14 12:51:27 UTC (rev 120316)
+++ trunk/LayoutTests/ChangeLog	2012-06-14 13:05:00 UTC (rev 120317)
@@ -1,3 +1,13 @@
+2012-06-14  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Device Metrics] "Fit window" results in duplicate rescaling in WebDevToolsAgentImpl::autoZoomPageToFitWidth()
+        https://bugs.webkit.org/show_bug.cgi?id=89092
+
+        Reviewed by Pavel Feldman.
+
+        * platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt:
+        * platform/chromium/inspector/styles/device-metrics-fit-window.html:
+
 2012-06-14  Kristóf Kosztyó  <[email protected]>
 
         [Qt] Unreviewed gardening after r120314.

Modified: trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt (120316 => 120317)


--- trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt	2012-06-14 12:51:27 UTC (rev 120316)
+++ trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt	2012-06-14 13:05:00 UTC (rev 120317)
@@ -1,5 +1,6 @@
 Tests that emulating device metrics with "Fit window" for a small FrameView correctly downscales page content.
 
-123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
-document: 780x585, #main: 1024x84
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+document: 480x800, #main: 1024x1280, window: 1024x1706
+document: 351x909, #main: 1024x2520, window: 1024x1706
 

Modified: trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window.html (120316 => 120317)


--- trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window.html	2012-06-14 12:51:27 UTC (rev 120316)
+++ trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window.html	2012-06-14 13:05:00 UTC (rev 120317)
@@ -25,26 +25,39 @@
         width: document.width,
         height: document.height,
         mainWidth: mainElement().offsetWidth,
-        mainHeight: mainElement().offsetHeight
+        mainHeight: mainElement().offsetHeight,
+        innerWidth: window.innerWidth,
+        innerHeight: window.innerHeight
     });
 }
 
 function test()
 {
-    function finalCallback(result)
+    PageAgent.enable();
+    setAndDumpOverride(480, 800, 1.1, false, step1);
+
+    function step1()
     {
-        var value = JSON.parse(result.value);
-        InspectorTest.addResult("document: " + value.width + "x" + value.height + ", #main: " + value.mainWidth + "x" + value.mainHeight);
-        InspectorTest.completeTest();
+        setAndDumpOverride(480, 800, 1.1, true, InspectorTest.completeTest.bind(InspectorTest));
     }
 
-    function overrideCallback()
+    function setAndDumpOverride(width, height, textSizeRatio, fitWindow, callback)
     {
-        InspectorTest.evaluateInPage("getDimensions()", finalCallback);
+        function finalCallback(result)
+        {
+            var value = JSON.parse(result.value);
+            InspectorTest.addResult("document: " + value.width + "x" + value.height + ", #main: " + value.mainWidth + "x" + value.mainHeight + ", window: " + value.innerWidth + "x" + value.innerHeight);
+            if (callback)
+                callback();
+        }
+
+        function overrideCallback()
+        {
+            InspectorTest.evaluateInPage("getDimensions()", finalCallback);
+        }
+
+        PageAgent.setDeviceMetricsOverride(width, height, textSizeRatio, fitWindow, overrideCallback);
     }
-
-    PageAgent.enable();
-    PageAgent.setDeviceMetricsOverride(1024, 768, 1, true, overrideCallback);
 }
 </script>
 </head>
@@ -60,6 +73,51 @@
 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
+123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 
 </div>
 </body>
 </html>

Modified: trunk/Source/WebKit/chromium/ChangeLog (120316 => 120317)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-14 12:51:27 UTC (rev 120316)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-14 13:05:00 UTC (rev 120317)
@@ -1,3 +1,16 @@
+2012-06-14  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Device Metrics] "Fit window" results in duplicate rescaling in WebDevToolsAgentImpl::autoZoomPageToFitWidth()
+        https://bugs.webkit.org/show_bug.cgi?id=89092
+
+        Reviewed by Pavel Feldman.
+
+        Do not apply the sizeRatio after it has been applied in scaledEmulatedFrameSize().
+
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::DeviceMetricsSupport::autoZoomPageToFitWidth):
+        (WebKit::DeviceMetricsSupport::ensureOriginalZoomFactor):
+
 2012-06-14  Yoshifumi Inoue  <[email protected]>
 
         [Chromium][Forms] We should remove ENABLE_INPUT_TYPE_TIME=0 and so on to allows us to override them by ~/.gyp/include.gypi

Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (120316 => 120317)


--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2012-06-14 12:51:27 UTC (rev 120316)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2012-06-14 13:05:00 UTC (rev 120317)
@@ -234,8 +234,7 @@
         frame->setTextZoomFactor(m_webView->emulatedTextZoomFactor());
         WebSize scaledFrameSize = scaledEmulatedFrameSize(frame->view());
         ensureOriginalZoomFactor(frame->view());
-        double sizeRatio = static_cast<double>(scaledFrameSize.width) / m_emulatedFrameSize.width;
-        frame->setPageAndTextZoomFactors(sizeRatio * m_originalZoomFactor, m_webView->emulatedTextZoomFactor());
+        frame->setPageAndTextZoomFactors(m_originalZoomFactor, m_webView->emulatedTextZoomFactor());
         Document* doc = frame->document();
         doc->styleResolverChanged(RecalcStyleImmediately);
         doc->updateLayout();
@@ -270,8 +269,7 @@
         m_webView->setPageScaleFactor(1, WebPoint());
         m_webView->setZoomLevel(false, 0);
         WebSize scaledEmulatedSize = scaledEmulatedFrameSize(frameView);
-        Document* document = frameView->frame()->document();
-        double denominator = document->renderView() ? document->renderView()->viewWidth() : frameView->contentsWidth();
+        double denominator = frameView->contentsWidth();
         if (!denominator)
             denominator = 1;
         m_originalZoomFactor = static_cast<double>(scaledEmulatedSize.width) / denominator;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to