Title: [87882] trunk/Source/WebCore
Revision
87882
Author
m...@apple.com
Date
2011-06-02 00:21:12 -0700 (Thu, 02 Jun 2011)

Log Message

Incorrect UA style when printing a simple document
https://bugs.webkit.org/show_bug.cgi?id=61900

Reviewed by Anders Carlsson.

This is not testable in run-webkit-tests because unless the test is the first to run in an instance
of DumpRenderTree, it is not guaranteed that the full default style sheet has not been initialized.

* css/CSSStyleSelector.cpp:
(WebCore::loadFullDefaultStyle): Replace the simple default print style, which is now equal to the
simple default style, with a new RuleSet before adding the style rules from the full default sheet.
(WebCore::loadSimpleDefaultStyle): Set defaultPrintStyle to point to the default style. They are
equal in the simple case.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87881 => 87882)


--- trunk/Source/WebCore/ChangeLog	2011-06-02 07:04:05 UTC (rev 87881)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 07:21:12 UTC (rev 87882)
@@ -1,3 +1,19 @@
+2011-06-01  Dan Bernstein  <m...@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Incorrect UA style when printing a simple document
+        https://bugs.webkit.org/show_bug.cgi?id=61900
+
+        This is not testable in run-webkit-tests because unless the test is the first to run in an instance
+        of DumpRenderTree, it is not guaranteed that the full default style sheet has not been initialized.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::loadFullDefaultStyle): Replace the simple default print style, which is now equal to the
+        simple default style, with a new RuleSet before adding the style rules from the full default sheet.
+        (WebCore::loadSimpleDefaultStyle): Set defaultPrintStyle to point to the default style. They are
+        equal in the simple case.
+
 2011-06-01  Kent Tamura  <tk...@chromium.org>
 
         Reviewed by Dimitri Glazkov.

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (87881 => 87882)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-06-02 07:04:05 UTC (rev 87881)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-06-02 07:21:12 UTC (rev 87882)
@@ -558,9 +558,11 @@
 {
     if (simpleDefaultStyleSheet) {
         ASSERT(defaultStyle);
+        ASSERT(defaultPrintStyle == defaultStyle);
         delete defaultStyle;
         simpleDefaultStyleSheet->deref();
         defaultStyle = new RuleSet;
+        defaultPrintStyle = new RuleSet;
         simpleDefaultStyleSheet = 0;
     } else {
         ASSERT(!defaultStyle);
@@ -587,7 +589,8 @@
     ASSERT(!simpleDefaultStyleSheet);
     
     defaultStyle = new RuleSet;
-    defaultPrintStyle = new RuleSet;
+    // There are no media-specific rules in the simple default style.
+    defaultPrintStyle = defaultStyle;
     defaultQuirksStyle = new RuleSet;
 
     simpleDefaultStyleSheet = parseUASheet(simpleUserAgentStyleSheet, strlen(simpleUserAgentStyleSheet));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to