OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 bool hasFailedOrCanceledSubresources() const; | 115 bool hasFailedOrCanceledSubresources() const; |
116 | 116 |
117 static unsigned averageSizeInBytes(); | 117 static unsigned averageSizeInBytes(); |
118 | 118 |
119 #ifndef NDEBUG | 119 #ifndef NDEBUG |
120 void showStyle(); | 120 void showStyle(); |
121 #endif | 121 #endif |
122 | 122 |
123 bool propertyMatches(CSSPropertyID, const CSSValue*) const; | 123 bool propertyMatches(CSSPropertyID, const CSSValue*) const; |
124 | 124 |
125 void trace(Visitor*); | 125 DECLARE_TRACE(); |
126 void traceAfterDispatch(Visitor*) { } | 126 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } |
127 | 127 |
128 protected: | 128 protected: |
129 | 129 |
130 enum { MaxArraySize = (1 << 28) - 1 }; | 130 enum { MaxArraySize = (1 << 28) - 1 }; |
131 | 131 |
132 StylePropertySet(CSSParserMode cssParserMode) | 132 StylePropertySet(CSSParserMode cssParserMode) |
133 : m_cssParserMode(cssParserMode) | 133 : m_cssParserMode(cssParserMode) |
134 , m_isMutable(true) | 134 , m_isMutable(true) |
135 , m_arraySize(0) | 135 , m_arraySize(0) |
136 { } | 136 { } |
(...skipping 15 matching lines...) Expand all Loading... |
152 public: | 152 public: |
153 ~ImmutableStylePropertySet(); | 153 ~ImmutableStylePropertySet(); |
154 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> create(const CSSPro
perty* properties, unsigned count, CSSParserMode); | 154 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> create(const CSSPro
perty* properties, unsigned count, CSSParserMode); |
155 | 155 |
156 unsigned propertyCount() const { return m_arraySize; } | 156 unsigned propertyCount() const { return m_arraySize; } |
157 | 157 |
158 const RawPtrWillBeMember<CSSValue>* valueArray() const; | 158 const RawPtrWillBeMember<CSSValue>* valueArray() const; |
159 const StylePropertyMetadata* metadataArray() const; | 159 const StylePropertyMetadata* metadataArray() const; |
160 int findPropertyIndex(CSSPropertyID) const; | 160 int findPropertyIndex(CSSPropertyID) const; |
161 | 161 |
162 void traceAfterDispatch(Visitor*); | 162 DECLARE_TRACE_AFTER_DISPATCH(); |
163 | 163 |
164 void* operator new(std::size_t, void* location) | 164 void* operator new(std::size_t, void* location) |
165 { | 165 { |
166 return location; | 166 return location; |
167 } | 167 } |
168 | 168 |
169 void* m_storage; | 169 void* m_storage; |
170 | 170 |
171 private: | 171 private: |
172 ImmutableStylePropertySet(const CSSProperty*, unsigned count, CSSParserMode)
; | 172 ImmutableStylePropertySet(const CSSProperty*, unsigned count, CSSParserMode)
; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 void removeEquivalentProperties(const CSSStyleDeclaration*); | 213 void removeEquivalentProperties(const CSSStyleDeclaration*); |
214 | 214 |
215 void mergeAndOverrideOnConflict(const StylePropertySet*); | 215 void mergeAndOverrideOnConflict(const StylePropertySet*); |
216 | 216 |
217 void clear(); | 217 void clear(); |
218 void parseDeclaration(const String& styleDeclaration, StyleSheetContents* co
ntextStyleSheet); | 218 void parseDeclaration(const String& styleDeclaration, StyleSheetContents* co
ntextStyleSheet); |
219 | 219 |
220 CSSStyleDeclaration* ensureCSSStyleDeclaration(); | 220 CSSStyleDeclaration* ensureCSSStyleDeclaration(); |
221 int findPropertyIndex(CSSPropertyID) const; | 221 int findPropertyIndex(CSSPropertyID) const; |
222 | 222 |
223 void traceAfterDispatch(Visitor*); | 223 DECLARE_TRACE_AFTER_DISPATCH(); |
224 | 224 |
225 private: | 225 private: |
226 explicit MutableStylePropertySet(CSSParserMode); | 226 explicit MutableStylePropertySet(CSSParserMode); |
227 explicit MutableStylePropertySet(const StylePropertySet&); | 227 explicit MutableStylePropertySet(const StylePropertySet&); |
228 MutableStylePropertySet(const CSSProperty* properties, unsigned count); | 228 MutableStylePropertySet(const CSSProperty* properties, unsigned count); |
229 | 229 |
230 bool removeShorthandProperty(CSSPropertyID); | 230 bool removeShorthandProperty(CSSPropertyID); |
231 CSSProperty* findCSSPropertyWithID(CSSPropertyID); | 231 CSSProperty* findCSSPropertyWithID(CSSPropertyID); |
232 OwnPtrWillBeMember<PropertySetCSSStyleDeclaration> m_cssomWrapper; | 232 OwnPtrWillBeMember<PropertySetCSSStyleDeclaration> m_cssomWrapper; |
233 | 233 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const | 295 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const |
296 { | 296 { |
297 if (m_isMutable) | 297 if (m_isMutable) |
298 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); | 298 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); |
299 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); | 299 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); |
300 } | 300 } |
301 | 301 |
302 } // namespace blink | 302 } // namespace blink |
303 | 303 |
304 #endif // StylePropertySet_h | 304 #endif // StylePropertySet_h |
OLD | NEW |