Title: [121556] trunk
Revision
121556
Author
[email protected]
Date
2012-06-29 06:52:10 -0700 (Fri, 29 Jun 2012)

Log Message

Web Inspector: [Device Metrics] "Fit window" option inhibits adjusting the page zoom factor
https://bugs.webkit.org/show_bug.cgi?id=90187

Reviewed by Vsevolod Vlasov.

Source/WebKit/chromium:

This change fixes the stale zoom factor, which does not get updated upon browser window resize in the "Fit window" mode.
The expected test results have little to do with actual dimensions of the test page in Chrome on a real mobile device,
since Chrome on the mobile uses a different zooming technique (pageScaleFactor-based viewport using layout width
rather than plain pageZoomFactor) and font boosting, which has not been upstreamed yet.

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

LayoutTests:

* inspector/styles/override-screen-size-expected.txt:
* platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (121555 => 121556)


--- trunk/LayoutTests/ChangeLog	2012-06-29 12:51:57 UTC (rev 121555)
+++ trunk/LayoutTests/ChangeLog	2012-06-29 13:52:10 UTC (rev 121556)
@@ -1,3 +1,13 @@
+2012-06-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Device Metrics] "Fit window" option inhibits adjusting the page zoom factor
+        https://bugs.webkit.org/show_bug.cgi?id=90187
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/styles/override-screen-size-expected.txt:
+        * platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt:
+
 2012-06-29  Kent Tamura  <[email protected]>
 
         <textarea> unnecessarily saves the value in some cases

Modified: trunk/LayoutTests/inspector/styles/override-screen-size-expected.txt (121555 => 121556)


--- trunk/LayoutTests/inspector/styles/override-screen-size-expected.txt	2012-06-29 12:51:57 UTC (rev 121555)
+++ trunk/LayoutTests/inspector/styles/override-screen-size-expected.txt	2012-06-29 13:52:10 UTC (rev 121556)
@@ -2,8 +2,8 @@
 
 Override: 480x800
 Screen from page: 480x800
-Window from page: 351x585
-Body from page: 351x585
+Window from page: 480x800
+Body from page: 480x800
 Main style:
 [expanded] 
 element.style  { ()
@@ -22,8 +22,8 @@
 
 Override: 800x480
 Screen from page: 800x480
-Window from page: 785x471
-Body from page: 785x471
+Window from page: 800x480
+Body from page: 800x480
 Main style:
 [expanded] 
 element.style  { ()
@@ -40,8 +40,8 @@
 Override: 480x-1 => ERROR
 Current dimensions:
 Screen from page: 800x480
-Window from page: 785x471
-Body from page: 785x471
+Window from page: 800x480
+Body from page: 800x480
 Disable PageAgent:
 Screen size same as original - OK
 Enable PageAgent:

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


--- trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt	2012-06-29 12:51:57 UTC (rev 121555)
+++ trunk/LayoutTests/platform/chromium/inspector/styles/device-metrics-fit-window-expected.txt	2012-06-29 13:52:10 UTC (rev 121556)
@@ -2,5 +2,5 @@
 
 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 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
+document: 351x1245, #main: 1025x4787, window: 1400x2333
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (121555 => 121556)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-29 12:51:57 UTC (rev 121555)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-29 13:52:10 UTC (rev 121556)
@@ -1,3 +1,19 @@
+2012-06-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Device Metrics] "Fit window" option inhibits adjusting the page zoom factor
+        https://bugs.webkit.org/show_bug.cgi?id=90187
+
+        Reviewed by Vsevolod Vlasov.
+
+        This change fixes the stale zoom factor, which does not get updated upon browser window resize in the "Fit window" mode.
+        The expected test results have little to do with actual dimensions of the test page in Chrome on a real mobile device,
+        since Chrome on the mobile uses a different zooming technique (pageScaleFactor-based viewport using layout width
+        rather than plain pageZoomFactor) and font boosting, which has not been upstreamed yet.
+
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::DeviceMetricsSupport::autoZoomPageToFitWidth):
+        (WebKit::DeviceMetricsSupport::ensureOriginalZoomFactor):
+
 2012-06-29  Konrad Piascik  <[email protected]>
 
         Don't hardcode target dpi of 160 (it should be 96 on desktop)

Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (121555 => 121556)


--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2012-06-29 12:51:57 UTC (rev 121555)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2012-06-29 13:52:10 UTC (rev 121556)
@@ -232,10 +232,12 @@
 
         frame->setTextZoomFactor(m_webView->emulatedTextZoomFactor());
         ensureOriginalZoomFactor(frame->view());
-        frame->setPageAndTextZoomFactors(m_originalZoomFactor, m_webView->emulatedTextZoomFactor());
-        Document* doc = frame->document();
-        doc->styleResolverChanged(RecalcStyleImmediately);
-        doc->updateLayout();
+        Document* document = frame->document();
+        float numerator = document->renderView() ? document->renderView()->viewWidth() : frame->view()->contentsWidth();
+        float factor = m_originalZoomFactor * (numerator / m_emulatedFrameSize.width);
+        frame->setPageAndTextZoomFactors(factor, m_webView->emulatedTextZoomFactor());
+        document->styleResolverChanged(RecalcStyleImmediately);
+        document->updateLayout();
     }
 
     void webViewResized()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to