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

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

Issue 2860483003: Move StyleBackgroundData.h to a nested class in ComputedStyle. (Closed)
Patch Set: Rebase Created 3 years, 8 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 7730ee9b3523a89b8dfb60ac6101efda816bef00..713fd153ca572892b6552669c0cf2c884ade7e3b 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -37,7 +37,6 @@
#include "core/style/LineClampValue.h"
#include "core/style/NinePieceImage.h"
#include "core/style/SVGComputedStyle.h"
-#include "core/style/StyleBackgroundData.h"
#include "core/style/StyleBoxData.h"
#include "core/style/StyleContentAlignmentData.h"
#include "core/style/StyleDeprecatedFlexibleBoxData.h"
@@ -182,6 +181,35 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
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_;
« no previous file with comments | « third_party/WebKit/Source/core/style/BUILD.gn ('k') | third_party/WebKit/Source/core/style/StyleBackgroundData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698