| Index: Source/core/paint/BoxPainter.cpp
|
| diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp
|
| index fde6d420b05ecee358b48cce77aae4540b1f3dc3..f8ce12e6bd85a23c0cdebf59cbcc752ae2fe06b4 100644
|
| --- a/Source/core/paint/BoxPainter.cpp
|
| +++ b/Source/core/paint/BoxPainter.cpp
|
| @@ -312,13 +312,7 @@ void BoxPainter::paintFillLayerExtended(LayoutBoxModelObject& obj, const PaintIn
|
| Color bgColor = color;
|
| StyleImage* bgImage = bgLayer.image();
|
|
|
| - bool forceBackgroundToWhite = false;
|
| - if (obj.document().printing()) {
|
| - if (obj.style()->printColorAdjust() == PrintColorAdjustEconomy)
|
| - forceBackgroundToWhite = true;
|
| - if (obj.document().settings() && obj.document().settings()->shouldPrintBackgrounds())
|
| - forceBackgroundToWhite = false;
|
| - }
|
| + bool forceBackgroundToWhite = shouldForceWhiteBackgroundForPrintEconomy(obj.styleRef(), obj.document());
|
|
|
| // When printing backgrounds is disabled or using economy mode,
|
| // change existing background colors and images to a solid white background.
|
| @@ -1055,4 +1049,10 @@ void BoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutRect& paintRe
|
| }
|
| }
|
|
|
| +bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
|
| +{
|
| + return document.printing() && style.printColorAdjust() == PrintColorAdjustEconomy
|
| + && (!document.settings() || !document.settings()->shouldPrintBackgrounds());
|
| +}
|
| +
|
| } // namespace blink
|
|
|