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 26 matching lines...) Expand all Loading... |
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/StyleContentAlignmentData.h" | 40 #include "core/style/StyleContentAlignmentData.h" |
41 #include "core/style/StyleDeprecatedFlexibleBoxData.h" | 41 #include "core/style/StyleDeprecatedFlexibleBoxData.h" |
42 #include "core/style/StyleDifference.h" | 42 #include "core/style/StyleDifference.h" |
43 #include "core/style/StyleFilterData.h" | 43 #include "core/style/StyleFilterData.h" |
44 #include "core/style/StyleFlexibleBoxData.h" | 44 #include "core/style/StyleFlexibleBoxData.h" |
45 #include "core/style/StyleGridData.h" | 45 #include "core/style/StyleGridData.h" |
46 #include "core/style/StyleGridItemData.h" | 46 #include "core/style/StyleGridItemData.h" |
47 #include "core/style/StyleInheritedData.h" | |
48 #include "core/style/StyleMultiColData.h" | 47 #include "core/style/StyleMultiColData.h" |
49 #include "core/style/StyleOffsetRotation.h" | 48 #include "core/style/StyleOffsetRotation.h" |
50 #include "core/style/StyleRareInheritedData.h" | 49 #include "core/style/StyleRareInheritedData.h" |
51 #include "core/style/StyleRareNonInheritedData.h" | 50 #include "core/style/StyleRareNonInheritedData.h" |
52 #include "core/style/StyleReflection.h" | 51 #include "core/style/StyleReflection.h" |
53 #include "core/style/StyleSelfAlignmentData.h" | 52 #include "core/style/StyleSelfAlignmentData.h" |
54 #include "core/style/StyleTransformData.h" | 53 #include "core/style/StyleTransformData.h" |
55 #include "core/style/StyleWillChangeData.h" | 54 #include "core/style/StyleWillChangeData.h" |
56 #include "core/style/TransformOrigin.h" | 55 #include "core/style/TransformOrigin.h" |
57 #include "platform/Length.h" | 56 #include "platform/Length.h" |
58 #include "platform/LengthBox.h" | 57 #include "platform/LengthBox.h" |
59 #include "platform/LengthPoint.h" | 58 #include "platform/LengthPoint.h" |
60 #include "platform/LengthSize.h" | 59 #include "platform/LengthSize.h" |
61 #include "platform/RuntimeEnabledFeatures.h" | 60 #include "platform/RuntimeEnabledFeatures.h" |
62 #include "platform/ThemeTypes.h" | 61 #include "platform/ThemeTypes.h" |
| 62 #include "platform/fonts/Font.h" |
63 #include "platform/fonts/FontDescription.h" | 63 #include "platform/fonts/FontDescription.h" |
64 #include "platform/geometry/FloatRoundedRect.h" | 64 #include "platform/geometry/FloatRoundedRect.h" |
65 #include "platform/geometry/LayoutRectOutsets.h" | 65 #include "platform/geometry/LayoutRectOutsets.h" |
66 #include "platform/graphics/Color.h" | 66 #include "platform/graphics/Color.h" |
67 #include "platform/graphics/TouchAction.h" | 67 #include "platform/graphics/TouchAction.h" |
68 #include "platform/scroll/ScrollTypes.h" | 68 #include "platform/scroll/ScrollTypes.h" |
69 #include "platform/text/TextDirection.h" | 69 #include "platform/text/TextDirection.h" |
70 #include "platform/text/UnicodeBidi.h" | 70 #include "platform/text/UnicodeBidi.h" |
71 #include "platform/transforms/TransformOperations.h" | 71 #include "platform/transforms/TransformOperations.h" |
72 #include "platform/wtf/Forward.h" | 72 #include "platform/wtf/Forward.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 friend class ColorPropertyFunctions; | 173 friend class ColorPropertyFunctions; |
174 | 174 |
175 // FIXME: When we stop resolving currentColor at style time, these can be | 175 // FIXME: When we stop resolving currentColor at style time, these can be |
176 // removed. | 176 // removed. |
177 friend class CSSToStyleMap; | 177 friend class CSSToStyleMap; |
178 friend class FilterOperationResolver; | 178 friend class FilterOperationResolver; |
179 friend class StyleBuilderConverter; | 179 friend class StyleBuilderConverter; |
180 friend class StyleResolverState; | 180 friend class StyleResolverState; |
181 friend class StyleResolver; | 181 friend class StyleResolver; |
182 | 182 |
| 183 private: |
| 184 class StyleInheritedData : public RefCountedCopyable<StyleInheritedData> { |
| 185 public: |
| 186 static PassRefPtr<StyleInheritedData> Create() { |
| 187 return AdoptRef(new StyleInheritedData); |
| 188 } |
| 189 PassRefPtr<StyleInheritedData> Copy() const { |
| 190 return AdoptRef(new StyleInheritedData(*this)); |
| 191 } |
| 192 |
| 193 bool operator==(const StyleInheritedData& other) const { |
| 194 return line_height_ == other.line_height_ && font_ == other.font_ && |
| 195 color_ == other.color_ && |
| 196 visited_link_color_ == other.visited_link_color_ && |
| 197 horizontal_border_spacing_ == other.horizontal_border_spacing_ && |
| 198 text_autosizing_multiplier_ == other.text_autosizing_multiplier_ && |
| 199 vertical_border_spacing_ == other.vertical_border_spacing_; |
| 200 } |
| 201 bool operator!=(const StyleInheritedData& o) const { return !(*this == o); } |
| 202 |
| 203 short horizontal_border_spacing_; |
| 204 short vertical_border_spacing_; |
| 205 |
| 206 // could be packed in a short but doesn't |
| 207 // make a difference currently because of padding |
| 208 Length line_height_; |
| 209 |
| 210 Font font_; |
| 211 Color color_; |
| 212 Color visited_link_color_; |
| 213 float text_autosizing_multiplier_; |
| 214 |
| 215 private: |
| 216 StyleInheritedData() |
| 217 : horizontal_border_spacing_(0), |
| 218 vertical_border_spacing_(0), |
| 219 line_height_(Length(-100.0, kPercent)), |
| 220 color_(Color::kBlack), |
| 221 visited_link_color_(Color::kBlack), |
| 222 text_autosizing_multiplier_(1) {} |
| 223 |
| 224 StyleInheritedData(const StyleInheritedData&) = default; |
| 225 }; |
| 226 |
183 protected: | 227 protected: |
184 // non-inherited attributes | 228 // non-inherited attributes |
185 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; | 229 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; |
186 | 230 |
187 // inherited attributes | 231 // inherited attributes |
188 DataRef<StyleRareInheritedData> rare_inherited_data_; | 232 DataRef<StyleRareInheritedData> rare_inherited_data_; |
189 DataRef<StyleInheritedData> inherited_data_; | 233 DataRef<StyleInheritedData> inherited_data_; |
190 | 234 |
191 // list of associated pseudo styles | 235 // list of associated pseudo styles |
192 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; | 236 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; |
(...skipping 3580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3817 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3774 } | 3818 } |
3775 | 3819 |
3776 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3820 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3777 return PseudoBitsInternal() & kElementPseudoIdMask; | 3821 return PseudoBitsInternal() & kElementPseudoIdMask; |
3778 } | 3822 } |
3779 | 3823 |
3780 } // namespace blink | 3824 } // namespace blink |
3781 | 3825 |
3782 #endif // ComputedStyle_h | 3826 #endif // ComputedStyle_h |
OLD | NEW |