Title: [99022] trunk
Revision
99022
Author
[email protected]
Date
2011-11-01 18:23:09 -0700 (Tue, 01 Nov 2011)

Log Message

WIP: Add CSS property to control printing of backgrounds for individual elements.
https://bugs.webkit.org/show_bug.cgi?id=64583

Reviewed by Eric Seidel.

Added test LayoutTests/fast/css/webkit-color-adjust.html,
Updated tests under LayoutTests/fast/css/getComputedStyle
Updated test under LayoutTests/svg/css

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::styleForDocument):
(WebCore::CSSStyleSelector::applyProperty):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::initialForceBackgroundsToWhite):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt (99021 => 99022)


--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -177,6 +177,7 @@
 -webkit-nbsp-mode: normal;
 -webkit-perspective: none;
 -webkit-perspective-origin: 392px 288px;
+-webkit-print-color-adjust: economy;
 -webkit-rtl-ordering: logical;
 -webkit-text-combine: none;
 -webkit-text-decorations-in-effect: none;

Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (99021 => 99022)


--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -176,6 +176,7 @@
     -webkit-nbsp-mode: normal
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%
+    -webkit-print-color-adjust: economy
     -webkit-rtl-ordering: logical
     -webkit-text-combine: none
     -webkit-text-decorations-in-effect: none

Added: trunk/LayoutTests/fast/css/webkit-color-adjust-expected.txt (0 => 99022)


--- trunk/LayoutTests/fast/css/webkit-color-adjust-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-color-adjust-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -0,0 +1,2 @@
+SUCCESS
+SUCCESS

Added: trunk/LayoutTests/fast/css/webkit-color-adjust.html (0 => 99022)


--- trunk/LayoutTests/fast/css/webkit-color-adjust.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/webkit-color-adjust.html	2011-11-02 01:23:09 UTC (rev 99022)
@@ -0,0 +1,28 @@
+<head>
+<script>
+var output = [];
+
+function test(id, expected) {
+    var adjust = window.getComputedStyle(document.getElementById(id)).webkitPrintColorAdjust;
+    if (adjust == expected)
+        output.push("SUCCESS");
+    else
+        output.push("FAILURE.  -webkit-print-color-adjust was " + adjust + ", it should have been " + expected);
+}
+
+function runTests() {
+    if (window.layoutTestController)
+        window.layoutTestController.dumpAsText();
+
+    test("economy", "economy");
+    test("exact", "exact");
+
+    document.body.innerHTML = output.join("\n");
+}
+
+</script>
+</head>
+<body _onLoad_="runTests();" style="white-space: pre-wrap;">
+<div id="economy" style="-webkit-print-color-adjust:economy;"></div>
+<div id="exact" style="-webkit-print-color-adjust:exact;"></div>
+</body>

Modified: trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt (99021 => 99022)


--- trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -177,6 +177,7 @@
 -webkit-nbsp-mode: normal;
 -webkit-perspective: none;
 -webkit-perspective-origin: 392px 288px;
+-webkit-print-color-adjust: economy;
 -webkit-rtl-ordering: logical;
 -webkit-text-combine: none;
 -webkit-text-decorations-in-effect: none;

Modified: trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (99021 => 99022)


--- trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -176,6 +176,7 @@
     -webkit-nbsp-mode: normal
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%
+    -webkit-print-color-adjust: economy
     -webkit-rtl-ordering: logical
     -webkit-text-combine: none
     -webkit-text-decorations-in-effect: none

Modified: trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt (99021 => 99022)


--- trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -352,6 +352,8 @@
 rect: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 rect: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-print-color-adjust) : economy
+rect: style.getPropertyCSSValue(-webkit-print-color-adjust) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-rtl-ordering) : logical
 rect: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-text-combine) : none
@@ -836,6 +838,8 @@
 g: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 g: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-print-color-adjust) : economy
+g: style.getPropertyCSSValue(-webkit-print-color-adjust) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-rtl-ordering) : logical
 g: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-text-combine) : none

Modified: trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (99021 => 99022)


--- trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-11-02 01:23:09 UTC (rev 99022)
@@ -352,6 +352,8 @@
 rect: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 rect: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-print-color-adjust) : economy
+rect: style.getPropertyCSSValue(-webkit-print-color-adjust) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-rtl-ordering) : logical
 rect: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-text-combine) : none
@@ -836,6 +838,8 @@
 g: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 g: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-print-color-adjust) : economy
+g: style.getPropertyCSSValue(-webkit-print-color-adjust) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-rtl-ordering) : logical
 g: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-text-combine) : none

Modified: trunk/Source/WebCore/ChangeLog (99021 => 99022)


--- trunk/Source/WebCore/ChangeLog	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/ChangeLog	2011-11-02 01:23:09 UTC (rev 99022)
@@ -1,3 +1,27 @@
+2011-11-01  Luke Macpherson   <[email protected]>
+
+        WIP: Add CSS property to control printing of backgrounds for individual elements.
+        https://bugs.webkit.org/show_bug.cgi?id=64583
+
+        Reviewed by Eric Seidel.
+
+        Added test LayoutTests/fast/css/webkit-color-adjust.html,
+        Updated tests under LayoutTests/fast/css/getComputedStyle
+        Updated test under LayoutTests/svg/css
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::styleForDocument):
+        (WebCore::CSSStyleSelector::applyProperty):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::initialForceBackgroundsToWhite):
+
 2011-11-01  Dominic Cooney  <[email protected]>
 
         Remove initErrorEvent method

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (99021 => 99022)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -251,6 +251,7 @@
     CSSPropertyWebkitNbspMode,
     CSSPropertyWebkitPerspective,
     CSSPropertyWebkitPerspectiveOrigin,
+    CSSPropertyWebkitPrintColorAdjust,
     CSSPropertyWebkitRtlOrdering,
 #if ENABLE(TOUCH_EVENTS)
     CSSPropertyWebkitTapHighlightColor,
@@ -1336,6 +1337,8 @@
             return primitiveValueCache->createValue(style->clear());
         case CSSPropertyColor:
             return primitiveValueCache->createColorValue(m_allowVisitedStyle ? style->visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb());
+        case CSSPropertyWebkitPrintColorAdjust:
+            return primitiveValueCache->createValue(style->printColorAdjust());
         case CSSPropertyWebkitColumnAxis:
             return primitiveValueCache->createValue(style->columnAxis());
         case CSSPropertyWebkitColumnCount:

Modified: trunk/Source/WebCore/css/CSSParser.cpp (99021 => 99022)


--- trunk/Source/WebCore/css/CSSParser.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -1699,6 +1699,10 @@
         if (value->id == CSSValueVisible || value->id == CSSValueHidden)
             validPrimitive = true;
         break;
+    case CSSPropertyWebkitPrintColorAdjust:
+        if (value->id == CSSValueExact || value->id == CSSValueEconomy)
+            validPrimitive = true;
+        break;
     case CSSPropertyWebkitPerspective:
         if (id == CSSValueNone)
             validPrimitive = true;

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (99021 => 99022)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2011-11-02 01:23:09 UTC (rev 99022)
@@ -155,6 +155,35 @@
     return ColumnSpanOne;
 }
 
+
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(PrintColorAdjust value)
+    : m_type(CSS_IDENT)
+    , m_hasCachedCSSText(false)
+{
+    switch (value) {
+    case PrintColorAdjustExact:
+        m_value.ident = CSSValueExact;
+        break;
+    case PrintColorAdjustEconomy:
+        m_value.ident = CSSValueEconomy;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator PrintColorAdjust() const
+{
+    switch (m_value.ident) {
+    case CSSValueEconomy:
+        return PrintColorAdjustEconomy;
+    case CSSValueExact:
+        return PrintColorAdjustExact;
+    default:
+        ASSERT_NOT_REACHED();
+        return PrintColorAdjustEconomy;
+    }
+}
+
+
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderStyle e)
     : m_type(CSS_IDENT)
     , m_hasCachedCSSText(false)

Modified: trunk/Source/WebCore/css/CSSProperty.cpp (99021 => 99022)


--- trunk/Source/WebCore/css/CSSProperty.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSProperty.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -334,6 +334,7 @@
     case CSSPropertyWebkitLineBreak:
     case CSSPropertyWebkitLineGrid:
     case CSSPropertyWebkitNbspMode:
+    case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRtlOrdering:
     case CSSPropertyWebkitTextCombine:
     case CSSPropertyWebkitTextDecorationsInEffect:

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (99021 => 99022)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2011-11-02 01:23:09 UTC (rev 99022)
@@ -320,6 +320,7 @@
 -webkit-perspective-origin
 -webkit-perspective-origin-x
 -webkit-perspective-origin-y
+-webkit-print-color-adjust
 -webkit-rtl-ordering
 -webkit-text-combine
 -epub-text-combine = -webkit-text-combine

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (99021 => 99022)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -1167,8 +1167,6 @@
     fontDescription.setUsePrinterFont(document->printing());
     if (Settings* settings = document->settings()) {
         fontDescription.setRenderingMode(settings->fontRenderingMode());
-        if (document->printing() && !settings->shouldPrintBackgrounds())
-            documentStyle->setForceBackgroundsToWhite(true);
         const AtomicString& stdfont = settings->standardFontFamily();
         if (!stdfont.isEmpty()) {
             fontDescription.setGenericFamily(FontDescription::StandardFamily);
@@ -3646,6 +3644,9 @@
     case CSSPropertyWebkitTransformStyle:
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(transformStyle3D, TransformStyle3D)
         return;
+    case CSSPropertyWebkitPrintColorAdjust:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(printColorAdjust, PrintColorAdjust);
+        return;
     case CSSPropertyWebkitPerspective: {
         HANDLE_INHERIT_AND_INITIAL(perspective, Perspective)
         if (primitiveValue && primitiveValue->getIdent() == CSSValueNone) {

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (99021 => 99022)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2011-11-02 01:23:09 UTC (rev 99022)
@@ -757,6 +757,10 @@
 optimizeLegibility
 geometricPrecision
 
+// -webkit-color-adjust
+economy
+exact
+
 // -webkit-color-correction
 //default
 sRGB

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (99021 => 99022)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -43,6 +43,7 @@
 #include "RenderRubyRun.h"
 #include "RenderRubyText.h"
 #include "RenderTheme.h"
+#include "Settings.h"
 #include "SVGTextRunRenderingContext.h"
 #include "Text.h"
 #include "break_lines.h"
@@ -575,20 +576,28 @@
     } else {
         textFillColor = styleToUse->visitedDependentColor(CSSPropertyWebkitTextFillColor);
         
+        bool forceBackgroundToWhite = false;
+        if (isPrinting) {
+            if (styleToUse->printColorAdjust() == PrintColorAdjustEconomy)
+                forceBackgroundToWhite = true;
+            if (textRenderer()->document()->settings() && textRenderer()->document()->settings()->shouldPrintBackgrounds())
+                forceBackgroundToWhite = false;
+        }
+
         // Make the text fill color legible against a white background
-        if (styleToUse->forceBackgroundsToWhite())
+        if (forceBackgroundToWhite)
             textFillColor = correctedTextColor(textFillColor, Color::white);
 
         textStrokeColor = styleToUse->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
         
         // Make the text stroke color legible against a white background
-        if (styleToUse->forceBackgroundsToWhite())
+        if (forceBackgroundToWhite)
             textStrokeColor = correctedTextColor(textStrokeColor, Color::white);
 
         emphasisMarkColor = styleToUse->visitedDependentColor(CSSPropertyWebkitTextEmphasisColor);
         
         // Make the text stroke color legible against a white background
-        if (styleToUse->forceBackgroundsToWhite())
+        if (forceBackgroundToWhite)
             emphasisMarkColor = correctedTextColor(emphasisMarkColor, Color::white);
     }
 

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (99021 => 99022)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -36,6 +36,7 @@
 #include "RenderInline.h"
 #include "RenderLayer.h"
 #include "RenderView.h"
+#include "Settings.h"
 #include <wtf/CurrentTime.h>
 
 using namespace std;
@@ -613,13 +614,22 @@
     StyleImage* bgImage = bgLayer->image();
     bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style()->effectiveZoom());
     
-    // When this style flag is set, change existing background colors and images to a solid white background.
+    bool forceBackgroundToWhite = false;
+    if (document()->printing()) {
+        if (style()->printColorAdjust() == PrintColorAdjustEconomy)
+            forceBackgroundToWhite = true;
+        if (document()->settings() && document()->settings()->shouldPrintBackgrounds())
+            forceBackgroundToWhite = false;
+    }
+
+    // When printing backgrounds is disabled or using economy mode,
+    // change existing background colors and images to a solid white background.
     // If there's no bg color or image, leave it untouched to avoid affecting transparency.
     // We don't try to avoid loading the background images, because this style flag is only set
     // when printing, and at that point we've already loaded the background images anyway. (To avoid
     // loading the background images we'd have to do this check when applying styles rather than
     // while rendering.)
-    if (style()->forceBackgroundsToWhite()) {
+    if (forceBackgroundToWhite) {
         // Note that we can't reuse this variable below because the bgColor might be changed
         bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.isValid() && bgColor.alpha() > 0;
         if (shouldPaintBackgroundImage || shouldPaintBackgroundColor) {

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (99021 => 99022)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2011-11-02 01:23:09 UTC (rev 99022)
@@ -597,7 +597,7 @@
     if (inherited->color != other->inherited->color
         || inherited_flags._visibility != other->inherited_flags._visibility
         || inherited_flags._text_decorations != other->inherited_flags._text_decorations
-        || inherited_flags._force_backgrounds_to_white != other->inherited_flags._force_backgrounds_to_white
+        || inherited_flags.m_printColorAdjust != other->inherited_flags.m_printColorAdjust
         || inherited_flags._insideLink != other->inherited_flags._insideLink
         || surround->border != other->surround->border
         || *m_background.get() != *other->m_background.get()

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (99021 => 99022)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-11-02 01:23:09 UTC (rev 99022)
@@ -184,7 +184,7 @@
                 && (_white_space == other._white_space)
                 && (_box_direction == other._box_direction)
                 && (m_rtlOrdering == other.m_rtlOrdering)
-                && (_force_backgrounds_to_white == other._force_backgrounds_to_white)
+                && (m_printColorAdjust == other.m_printColorAdjust)
                 && (_pointerEvents == other._pointerEvents)
                 && (_insideLink == other._insideLink)
                 && (m_writingMode == other.m_writingMode);
@@ -209,7 +209,7 @@
         
         // non CSS2 inherited
         unsigned char m_rtlOrdering : 1; // Order
-        bool _force_backgrounds_to_white : 1;
+        unsigned char m_printColorAdjust : PrintColorAdjustBits;
         unsigned char _pointerEvents : 4; // EPointerEvents
         unsigned char _insideLink : 2; // EInsideLink
         // 43 bits
@@ -290,7 +290,7 @@
         inherited_flags._white_space = initialWhiteSpace();
         inherited_flags.m_rtlOrdering = initialRTLOrdering();
         inherited_flags._box_direction = initialBoxDirection();
-        inherited_flags._force_backgrounds_to_white = false;
+        inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
         inherited_flags._pointerEvents = initialPointerEvents();
         inherited_flags._insideLink = NotInsideLink;
         inherited_flags.m_writingMode = initialWritingMode();
@@ -1083,8 +1083,8 @@
     void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
     void setIsLink(bool b) { noninherited_flags._isLink = b; }
 
-    bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
-    void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
+    PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); }
+    void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; }
 
     bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
     void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) }
@@ -1476,6 +1476,7 @@
     static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
     static StyleImage* initialBorderImageSource() { return 0; }
     static StyleImage* initialMaskBoxImageSource() { return 0; }
+    static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
 
     static const AtomicString& initialLineGrid() { return nullAtom; }
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (99021 => 99022)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2011-11-02 01:20:44 UTC (rev 99021)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2011-11-02 01:23:09 UTC (rev 99022)
@@ -36,6 +36,11 @@
  * in CSSValueKeywords.in, otherwise some optimizations in the parser will fail,
  * and produce invalid results.
  */
+static const size_t PrintColorAdjustBits = 1;
+enum PrintColorAdjust {
+    PrintColorAdjustEconomy,
+    PrintColorAdjustExact
+};
 
 // The difference between two styles.  The following values are used:
 // (1) StyleDifferenceEqual - The two styles are identical
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to