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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 19 matching lines...) Expand all
30 #include "core/CSSPropertyNames.h" 30 #include "core/CSSPropertyNames.h"
31 #include "core/ComputedStyleBase.h" 31 #include "core/ComputedStyleBase.h"
32 #include "core/CoreExport.h" 32 #include "core/CoreExport.h"
33 #include "core/style/BorderValue.h" 33 #include "core/style/BorderValue.h"
34 #include "core/style/ComputedStyleConstants.h" 34 #include "core/style/ComputedStyleConstants.h"
35 #include "core/style/CounterDirectives.h" 35 #include "core/style/CounterDirectives.h"
36 #include "core/style/DataRef.h" 36 #include "core/style/DataRef.h"
37 #include "core/style/LineClampValue.h" 37 #include "core/style/LineClampValue.h"
38 #include "core/style/NinePieceImage.h" 38 #include "core/style/NinePieceImage.h"
39 #include "core/style/SVGComputedStyle.h" 39 #include "core/style/SVGComputedStyle.h"
40 #include "core/style/StyleBackgroundData.h"
41 #include "core/style/StyleBoxData.h" 40 #include "core/style/StyleBoxData.h"
42 #include "core/style/StyleContentAlignmentData.h" 41 #include "core/style/StyleContentAlignmentData.h"
43 #include "core/style/StyleDeprecatedFlexibleBoxData.h" 42 #include "core/style/StyleDeprecatedFlexibleBoxData.h"
44 #include "core/style/StyleDifference.h" 43 #include "core/style/StyleDifference.h"
45 #include "core/style/StyleFilterData.h" 44 #include "core/style/StyleFilterData.h"
46 #include "core/style/StyleFlexibleBoxData.h" 45 #include "core/style/StyleFlexibleBoxData.h"
47 #include "core/style/StyleGridData.h" 46 #include "core/style/StyleGridData.h"
48 #include "core/style/StyleGridItemData.h" 47 #include "core/style/StyleGridItemData.h"
49 #include "core/style/StyleInheritedData.h" 48 #include "core/style/StyleInheritedData.h"
50 #include "core/style/StyleMultiColData.h" 49 #include "core/style/StyleMultiColData.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 friend class ColorPropertyFunctions; 174 friend class ColorPropertyFunctions;
176 175
177 // FIXME: When we stop resolving currentColor at style time, these can be 176 // FIXME: When we stop resolving currentColor at style time, these can be
178 // removed. 177 // removed.
179 friend class CSSToStyleMap; 178 friend class CSSToStyleMap;
180 friend class FilterOperationResolver; 179 friend class FilterOperationResolver;
181 friend class StyleBuilderConverter; 180 friend class StyleBuilderConverter;
182 friend class StyleResolverState; 181 friend class StyleResolverState;
183 friend class StyleResolver; 182 friend class StyleResolver;
184 183
184 private:
185 class StyleBackgroundData : public RefCountedCopyable<StyleBackgroundData> {
186 public:
187 static PassRefPtr<StyleBackgroundData> Create() {
188 return AdoptRef(new StyleBackgroundData);
189 }
190 PassRefPtr<StyleBackgroundData> Copy() const {
191 return AdoptRef(new StyleBackgroundData(*this));
192 }
193
194 bool operator==(const StyleBackgroundData& other) const {
195 return background_ == other.background_ &&
196 background_color_ == other.background_color_;
197 }
198 bool operator!=(const StyleBackgroundData& other) const {
199 return !(*this == other);
200 }
201
202 FillLayer background_;
203 StyleColor background_color_;
204
205 private:
206 StyleBackgroundData()
207 : background_(FillLayer(kBackgroundFillLayer, true)),
208 background_color_(Color::kTransparent) {}
209
210 StyleBackgroundData(const StyleBackgroundData&) = default;
211 };
212
185 protected: 213 protected:
186 // non-inherited attributes 214 // non-inherited attributes
187 DataRef<StyleBoxData> box_data_; 215 DataRef<StyleBoxData> box_data_;
188 DataRef<StyleVisualData> visual_data_; 216 DataRef<StyleVisualData> visual_data_;
189 DataRef<StyleBackgroundData> background_data_; 217 DataRef<StyleBackgroundData> background_data_;
190 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; 218 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_;
191 219
192 // inherited attributes 220 // inherited attributes
193 DataRef<StyleRareInheritedData> rare_inherited_data_; 221 DataRef<StyleRareInheritedData> rare_inherited_data_;
194 DataRef<StyleInheritedData> inherited_data_; 222 DataRef<StyleInheritedData> inherited_data_;
(...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after
3688 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3716 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3689 } 3717 }
3690 3718
3691 inline bool ComputedStyle::HasPseudoElementStyle() const { 3719 inline bool ComputedStyle::HasPseudoElementStyle() const {
3692 return PseudoBitsInternal() & kElementPseudoIdMask; 3720 return PseudoBitsInternal() & kElementPseudoIdMask;
3693 } 3721 }
3694 3722
3695 } // namespace blink 3723 } // namespace blink
3696 3724
3697 #endif // ComputedStyle_h 3725 #endif // ComputedStyle_h
OLDNEW
« 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