Printed font-size should not be dependant on zoom level
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2012 05:42:45 +0000 (05:42 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2012 05:42:45 +0000 (05:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79717

Reviewed by Adam Barth.

Ignore full page zoom level when printing a document.

Source/WebCore:

Test: printing/zoomed-document.html

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):

LayoutTests:

* printing/zoomed-document-expected.txt: Added.
* printing/zoomed-document.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/printing/zoomed-document-expected.txt [new file with mode: 0644]
LayoutTests/printing/zoomed-document.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp

index 2f99647..aaf59fd 100644 (file)
@@ -1,3 +1,15 @@
+2012-02-27  Emil A Eklund  <eae@chromium.org>
+
+        Printed font-size should not be dependant on zoom level
+        https://bugs.webkit.org/show_bug.cgi?id=79717
+
+        Reviewed by Adam Barth.
+
+        Ignore full page zoom level when printing a document.
+
+        * printing/zoomed-document-expected.txt: Added.
+        * printing/zoomed-document.html: Added.
+
 2012-02-27  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r109041.
diff --git a/LayoutTests/printing/zoomed-document-expected.txt b/LayoutTests/printing/zoomed-document-expected.txt
new file mode 100644 (file)
index 0000000..6bab435
--- /dev/null
@@ -0,0 +1 @@
+PASS Document zoom should not apply when printing.
diff --git a/LayoutTests/printing/zoomed-document.html b/LayoutTests/printing/zoomed-document.html
new file mode 100644 (file)
index 0000000..41e71a3
--- /dev/null
@@ -0,0 +1,27 @@
+<html>
+<body>
+<pre id="console">
+test
+</pre>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+
+    var msg = 'Document zoom should not apply when printing.';
+    var pass = true;
+
+    for (var i = 0; i < 10; i++) {
+        var numberOfPages = layoutTestController.numberOfPages(100, 30);
+        if (numberOfPages != 1) {
+            pass = false;
+            msg += 'Got ' + numberOfPages + ' pages, expected 1.\n';
+        }
+        eventSender.zoomPageIn();
+    }
+
+    msg = (pass ? 'PASS' : 'FAIL') + ' ' + msg;
+    document.querySelector('#console').textContent = msg;
+}
+</script>
+</body>
+</html>
index d70f7f2..57cbffa 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-27  Emil A Eklund  <eae@chromium.org>
+
+        Printed font-size should not be dependant on zoom level
+        https://bugs.webkit.org/show_bug.cgi?id=79717
+
+        Reviewed by Adam Barth.
+
+        Ignore full page zoom level when printing a document.
+
+        Test: printing/zoomed-document.html
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
 2012-02-27  Kenichi Ishibashi  <bashi@chromium.org>
 
         [Chromium] Unreviewed gardening, further compile fixes for
index f6c899e..974e299 100644 (file)
@@ -1436,7 +1436,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document, C
     RefPtr<RenderStyle> documentStyle = RenderStyle::create();
     documentStyle->setDisplay(BLOCK);
     documentStyle->setRTLOrdering(document->visuallyOrdered() ? VisualOrder : LogicalOrder);
-    documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
+    documentStyle->setZoom(frame && !document->printing() ? frame->pageZoomFactor() : 1);
     documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);
     documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY);
     documentStyle->setLocale(document->contentLanguage());