OLD | NEW |
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 friend class ColorPropertyFunctions; | 174 friend class ColorPropertyFunctions; |
175 | 175 |
176 // 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 |
177 // removed. | 177 // removed. |
178 friend class CSSToStyleMap; | 178 friend class CSSToStyleMap; |
179 friend class FilterOperationResolver; | 179 friend class FilterOperationResolver; |
180 friend class StyleBuilderConverter; | 180 friend class StyleBuilderConverter; |
181 friend class StyleResolverState; | 181 friend class StyleResolverState; |
182 friend class StyleResolver; | 182 friend class StyleResolver; |
183 | 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 |
184 protected: | 213 protected: |
185 // non-inherited attributes | 214 // non-inherited attributes |
186 DataRef<StyleBoxData> box_data_; | 215 DataRef<StyleBoxData> box_data_; |
187 DataRef<StyleVisualData> visual_data_; | 216 DataRef<StyleVisualData> visual_data_; |
| 217 DataRef<StyleBackgroundData> background_data_; |
188 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; | 218 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; |
189 | 219 |
190 // inherited attributes | 220 // inherited attributes |
191 DataRef<StyleRareInheritedData> rare_inherited_data_; | 221 DataRef<StyleRareInheritedData> rare_inherited_data_; |
192 DataRef<StyleInheritedData> inherited_data_; | 222 DataRef<StyleInheritedData> inherited_data_; |
193 | 223 |
194 // list of associated pseudo styles | 224 // list of associated pseudo styles |
195 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; | 225 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; |
196 | 226 |
197 DataRef<SVGComputedStyle> svg_style_; | 227 DataRef<SVGComputedStyle> svg_style_; |
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3686 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3716 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3687 } | 3717 } |
3688 | 3718 |
3689 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3719 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3690 return PseudoBitsInternal() & kElementPseudoIdMask; | 3720 return PseudoBitsInternal() & kElementPseudoIdMask; |
3691 } | 3721 } |
3692 | 3722 |
3693 } // namespace blink | 3723 } // namespace blink |
3694 | 3724 |
3695 #endif // ComputedStyle_h | 3725 #endif // ComputedStyle_h |
OLD | NEW |