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 "core/paint/BoxPainter.h" | 5 #include "core/paint/BoxPainter.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
10 #include "core/layout/ImageQualityController.h" | 10 #include "core/layout/ImageQualityController.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 -(obj.paddingBottom() + obj.borderBottom()), | 353 -(obj.paddingBottom() + obj.borderBottom()), |
354 -(obj.paddingLeft() + obj.borderLeft())), | 354 -(obj.paddingLeft() + obj.borderLeft())), |
355 includeLeftEdge, includeRightEdge); | 355 includeLeftEdge, includeRightEdge); |
356 } else if (bgLayer.clip() == PaddingFillBox) { | 356 } else if (bgLayer.clip() == PaddingFillBox) { |
357 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); | 357 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); |
358 } | 358 } |
359 | 359 |
360 clipToBorder.emplace(obj, paintInfo, rect, border, ApplyToContext); | 360 clipToBorder.emplace(obj, paintInfo, rect, border, ApplyToContext); |
361 } | 361 } |
362 | 362 |
363 int bLeft = includeLeftEdge ? obj.borderLeft() : 0; | 363 int bLeft = includeLeftEdge ? obj.borderLeft().floor() : 0; |
364 int bRight = includeRightEdge ? obj.borderRight() : 0; | 364 int bRight = includeRightEdge ? obj.borderRight().floor() : 0; |
365 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); | 365 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); |
366 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); | 366 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); |
367 | 367 |
368 GraphicsContextStateSaver clipWithScrollingStateSaver(context, clippedWithLo
calScrolling); | 368 GraphicsContextStateSaver clipWithScrollingStateSaver(context, clippedWithLo
calScrolling); |
369 LayoutRect scrolledPaintRect = rect; | 369 LayoutRect scrolledPaintRect = rect; |
370 if (clippedWithLocalScrolling) { | 370 if (clippedWithLocalScrolling) { |
371 // Clip to the overflow area. | 371 // Clip to the overflow area. |
372 const LayoutBox& thisBox = toLayoutBox(obj); | 372 const LayoutBox& thisBox = toLayoutBox(obj); |
373 // TODO(chrishtr): this should be pixel-snapped. | 373 // TODO(chrishtr): this should be pixel-snapped. |
374 context.clip(FloatRect(thisBox.overflowClipRect(rect.location()))); | 374 context.clip(FloatRect(thisBox.overflowClipRect(rect.location()))); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 691 } |
692 } | 692 } |
693 | 693 |
694 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 694 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
695 { | 695 { |
696 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy | 696 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy |
697 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 697 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
698 } | 698 } |
699 | 699 |
700 } // namespace blink | 700 } // namespace blink |
OLD | NEW |