Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: third_party/WebKit/Source/core/paint/BoxDecorationData.cpp

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Rebase w/HEAD Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698