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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // | 173 // |
174 // 2) Many of these data members can be packed as bit fields, so we use less | 174 // 2) Many of these data members can be packed as bit fields, so we use less |
175 // memory by packing them in this object with other bit fields. | 175 // memory by packing them in this object with other bit fields. |
176 // | 176 // |
177 // STORAGE: | 177 // STORAGE: |
178 // | 178 // |
179 // ComputedStyle is optimized for memory and performance. The data is not | 179 // ComputedStyle is optimized for memory and performance. The data is not |
180 // actually stored directly in ComputedStyle, but rather in a generated parent | 180 // actually stored directly in ComputedStyle, but rather in a generated parent |
181 // class ComputedStyleBase. This separation of concerns allows us to optimise | 181 // class ComputedStyleBase. This separation of concerns allows us to optimise |
182 // the memory layout without affecting users of ComputedStyle. ComputedStyle | 182 // the memory layout without affecting users of ComputedStyle. ComputedStyle |
183 // inherits from ComputedStyleBase, which in turn takes ComputedStyle as a | 183 // inherits from ComputedStyleBase. For more about the memory layout, there is |
184 // template argument so that ComputedStyleBase can access methods declared on | 184 // documentation in ComputedStyleBase and make_computed_style_base.py. |
185 // ComputedStyle. For more about the memory layout, there is documentation in | |
186 // ComputedStyleBase and make_computed_style_base.py. | |
187 // | 185 // |
188 // INTERFACE: | 186 // INTERFACE: |
189 // | 187 // |
190 // For most CSS properties, ComputedStyle provides a consistent interface which | 188 // For most CSS properties, ComputedStyle provides a consistent interface which |
191 // includes a getter, setter, initial method (the computed value when the | 189 // includes a getter, setter, initial method (the computed value when the |
192 // property is to 'initial'), and resetter (that resets the computed value to | 190 // property is to 'initial'), and resetter (that resets the computed value to |
193 // its initial value). Exceptions include vertical-align, which has a separate | 191 // its initial value). Exceptions include vertical-align, which has a separate |
194 // set of accessors for its length and its keyword components. Apart from | 192 // set of accessors for its length and its keyword components. Apart from |
195 // accessors, ComputedStyle also has a wealth of helper functions. | 193 // accessors, ComputedStyle also has a wealth of helper functions. |
196 // | 194 // |
197 // Because ComputedStyleBase defines simple accessors to every CSS property, | 195 // Because ComputedStyleBase defines simple accessors to every CSS property, |
198 // ComputedStyle inherits these and so they are not redeclared in this file. | 196 // ComputedStyle inherits these and so they are not redeclared in this file. |
199 // This means that the interface to ComputedStyle is split between this file and | 197 // This means that the interface to ComputedStyle is split between this file and |
200 // ComputedStyleBase.h. | 198 // ComputedStyleBase.h. |
201 // | 199 // |
202 // [1] https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value | 200 // [1] https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value |
203 // | 201 // |
204 // NOTE: | 202 // NOTE: |
205 // | 203 // |
206 // Currently, some properties are stored in ComputedStyle and some in | 204 // Currently, some properties are stored in ComputedStyle and some in |
207 // ComputedStyleBase. Eventually, the storage of all properties (except SVG | 205 // ComputedStyleBase. Eventually, the storage of all properties (except SVG |
208 // ones) will be in ComputedStyleBase. | 206 // ones) will be in ComputedStyleBase. |
209 class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>, | 207 class CORE_EXPORT ComputedStyle : public ComputedStyleBase, |
210 public RefCounted<ComputedStyle> { | 208 public RefCounted<ComputedStyle> { |
211 // Needed to allow access to private/protected getters of fields to allow diff | 209 // Needed to allow access to private/protected getters of fields to allow diff |
212 // generation | 210 // generation |
213 friend class ComputedStyleBase<ComputedStyle>; | 211 friend class ComputedStyleBase; |
214 // Used by Web Animations CSS. Sets the color styles. | 212 // Used by Web Animations CSS. Sets the color styles. |
215 friend class AnimatedStyleBuilder; | 213 friend class AnimatedStyleBuilder; |
216 // Used by Web Animations CSS. Gets visited and unvisited colors separately. | 214 // Used by Web Animations CSS. Gets visited and unvisited colors separately. |
217 friend class CSSAnimatableValueFactory; | 215 friend class CSSAnimatableValueFactory; |
218 // Used by CSS animations. We can't allow them to animate based off visited | 216 // Used by CSS animations. We can't allow them to animate based off visited |
219 // colors. | 217 // colors. |
220 friend class CSSPropertyEquality; | 218 friend class CSSPropertyEquality; |
221 // Editing has to only reveal unvisited info. | 219 // Editing has to only reveal unvisited info. |
222 friend class ApplyStyleCommand; | 220 friend class ApplyStyleCommand; |
223 // Editing has to only reveal unvisited info. | 221 // Editing has to only reveal unvisited info. |
(...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3586 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3584 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3587 } | 3585 } |
3588 | 3586 |
3589 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3587 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3590 return PseudoBitsInternal() & kElementPseudoIdMask; | 3588 return PseudoBitsInternal() & kElementPseudoIdMask; |
3591 } | 3589 } |
3592 | 3590 |
3593 } // namespace blink | 3591 } // namespace blink |
3594 | 3592 |
3595 #endif // ComputedStyle_h | 3593 #endif // ComputedStyle_h |
OLD | NEW |