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/BoxDecorationData.h" | 5 #include "core/paint/BoxDecorationData.h" |
6 | 6 |
7 #include "core/layout/LayoutBox.h" | 7 #include "core/layout/LayoutBox.h" |
8 #include "core/style/BorderEdge.h" | 8 #include "core/style/BorderEdge.h" |
9 #include "core/style/ComputedStyle.h" | 9 #include "core/style/ComputedStyle.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
11 #include "platform/graphics/GraphicsContext.h" | 11 #include "platform/graphics/GraphicsContext.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 BoxDecorationData::BoxDecorationData(const LayoutBox& layoutBox) | 15 BoxDecorationData::BoxDecorationData(const LayoutBox& layoutBox) |
16 { | 16 { |
17 backgroundColor = layoutBox.style()->visitedDependentColor(CSSPropertyBackgr
oundColor); | 17 backgroundColor = layoutBox.style()->visitedDependentColor(CSSPropertyBackgr
oundColor); |
18 hasBackground = backgroundColor.alpha() || layoutBox.style()->hasBackgroundI
mage(); | 18 hasBackground = backgroundColor.alpha() || layoutBox.style()->hasBackgroundI
mageOrBackdropFilter(); |
19 ASSERT(hasBackground == layoutBox.style()->hasBackground()); | 19 ASSERT(hasBackground == layoutBox.style()->hasBackground()); |
20 hasBorderDecoration = layoutBox.style()->hasBorderDecoration(); | 20 hasBorderDecoration = layoutBox.style()->hasBorderDecoration(); |
21 hasAppearance = layoutBox.style()->hasAppearance(); | 21 hasAppearance = layoutBox.style()->hasAppearance(); |
22 bleedAvoidance = determineBackgroundBleedAvoidance(layoutBox); | 22 bleedAvoidance = determineBackgroundBleedAvoidance(layoutBox); |
23 } | 23 } |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 bool borderObscuresBackgroundEdge(const ComputedStyle& style) | 27 bool borderObscuresBackgroundEdge(const ComputedStyle& style) |
28 { | 28 { |
(...skipping 24 matching lines...) Expand all Loading... |
53 return BackgroundBleedNone; | 53 return BackgroundBleedNone; |
54 } | 54 } |
55 | 55 |
56 if (borderObscuresBackgroundEdge(*layoutBox.style())) | 56 if (borderObscuresBackgroundEdge(*layoutBox.style())) |
57 return BackgroundBleedShrinkBackground; | 57 return BackgroundBleedShrinkBackground; |
58 | 58 |
59 return BackgroundBleedClipLayer; | 59 return BackgroundBleedClipLayer; |
60 } | 60 } |
61 | 61 |
62 } // namespace blink | 62 } // namespace blink |
OLD | NEW |