| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& paintOffset) | 59 LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& paintOffset) |
| 60 { | 60 { |
| 61 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) | 61 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) |
| 62 return LayoutRect(); | 62 return LayoutRect(); |
| 63 | 63 |
| 64 // Use the visual overflow rect here, because it will include overflow intro
duced by the theme. | 64 // Use the visual overflow rect here, because it will include overflow intro
duced by the theme. |
| 65 LayoutRect bounds = m_layoutBox.visualOverflowRect(); | 65 LayoutRect bounds = m_layoutBox.visualOverflowRect(); |
| 66 bounds.moveBy(paintOffset); | 66 bounds.moveBy(paintOffset); |
| 67 return LayoutRect(pixelSnappedIntRect(bounds)); | 67 return bounds; |
| 68 } | 68 } |
| 69 | 69 |
| 70 namespace { | 70 namespace { |
| 71 | 71 |
| 72 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) | 72 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) |
| 73 { | 73 { |
| 74 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr
oundBleedClipLayer; | 74 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr
oundBleedClipLayer; |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // anonymous namespace | 77 } // anonymous namespace |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 } | 762 } |
| 763 } | 763 } |
| 764 | 764 |
| 765 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 765 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
| 766 { | 766 { |
| 767 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy | 767 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy |
| 768 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 768 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace blink | 771 } // namespace blink |
| OLD | NEW |