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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2869633002: (DO NOT LAND) Revert of Generate StyleBackgroundData in ComputedStyleBase. (Closed)
Patch Set: 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/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 77c3d775e6028dac29d47d1b77f050c05da7b302..713fd153ca572892b6552669c0cf2c884ade7e3b 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -181,10 +181,40 @@
friend class StyleResolverState;
friend class StyleResolver;
+ private:
+ class StyleBackgroundData : public RefCountedCopyable<StyleBackgroundData> {
+ public:
+ static PassRefPtr<StyleBackgroundData> Create() {
+ return AdoptRef(new StyleBackgroundData);
+ }
+ PassRefPtr<StyleBackgroundData> Copy() const {
+ return AdoptRef(new StyleBackgroundData(*this));
+ }
+
+ bool operator==(const StyleBackgroundData& other) const {
+ return background_ == other.background_ &&
+ background_color_ == other.background_color_;
+ }
+ bool operator!=(const StyleBackgroundData& other) const {
+ return !(*this == other);
+ }
+
+ FillLayer background_;
+ StyleColor background_color_;
+
+ private:
+ StyleBackgroundData()
+ : background_(FillLayer(kBackgroundFillLayer, true)),
+ background_color_(Color::kTransparent) {}
+
+ StyleBackgroundData(const StyleBackgroundData&) = default;
+ };
+
protected:
// non-inherited attributes
DataRef<StyleBoxData> box_data_;
DataRef<StyleVisualData> visual_data_;
+ DataRef<StyleBackgroundData> background_data_;
DataRef<StyleRareNonInheritedData> rare_non_inherited_data_;
// inherited attributes

Powered by Google App Engine
This is Rietveld 408576698