Index: third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
diff --git a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
index 92b3573ab74fe47cb77414158188cb66abed6508..f2d56792354f450e90c9fa7173bbcf099d58d93c 100644 |
--- a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
+++ b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
@@ -5,6 +5,7 @@ |
#include "core/paint/BoxDecorationData.h" |
#include "core/layout/LayoutBox.h" |
+#include "core/layout/ng/ng_physical_fragment.h" |
#include "core/paint/BoxPainter.h" |
#include "core/style/BorderEdge.h" |
#include "core/style/ComputedStyle.h" |
@@ -13,17 +14,25 @@ |
namespace blink { |
-BoxDecorationData::BoxDecorationData(const LayoutBox& layout_box) { |
- background_color = |
- layout_box.Style()->VisitedDependentColor(CSSPropertyBackgroundColor); |
- has_background = |
- background_color.Alpha() || layout_box.Style()->HasBackgroundImage(); |
- DCHECK(has_background == layout_box.Style()->HasBackground()); |
- has_border_decoration = layout_box.Style()->HasBorderDecoration(); |
- has_appearance = layout_box.Style()->HasAppearance(); |
+BoxDecorationData::BoxDecorationData(const LayoutBox& layout_box) |
+ : BoxDecorationData(layout_box.Style()) { |
bleed_avoidance = DetermineBackgroundBleedAvoidance(layout_box); |
} |
+BoxDecorationData::BoxDecorationData(const NGPhysicalFragment* fragment) |
+ : BoxDecorationData(&fragment->Style()) { |
+ // TODO(layout-dev): Implement |
+ bleed_avoidance = kBackgroundBleedClipLayer; |
+} |
+ |
+BoxDecorationData::BoxDecorationData(const ComputedStyle* style) { |
+ background_color = style->VisitedDependentColor(CSSPropertyBackgroundColor); |
+ has_background = background_color.Alpha() || style->HasBackgroundImage(); |
+ DCHECK(has_background == style->HasBackground()); |
+ has_border_decoration = style->HasBorderDecoration(); |
+ has_appearance = style->HasAppearance(); |
+} |
+ |
namespace { |
bool BorderObscuresBackgroundEdge(const ComputedStyle& style) { |