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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 PassRefPtrWillBeRawPtr<MutableStylePropertySet> mutableCopy() const; | 109 PassRefPtrWillBeRawPtr<MutableStylePropertySet> mutableCopy() const; |
110 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() co nst; | 110 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() co nst; |
111 | 111 |
112 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Ve ctor<CSSPropertyID>&) const; | 112 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Ve ctor<CSSPropertyID>&) const; |
113 | 113 |
114 String asText() const; | 114 String asText() const; |
115 | 115 |
116 bool isMutable() const { return m_isMutable; } | 116 bool isMutable() const { return m_isMutable; } |
117 | 117 |
118 bool forceOverride() const { return m_forceOverride; } | |
leviw_travelin_and_unemployed
2015/04/21 22:58:41
Do you mean to include this stuff? Is it necessary
| |
119 void setForceOverride(bool b) { m_forceOverride = b; } | |
120 | |
118 bool hasFailedOrCanceledSubresources() const; | 121 bool hasFailedOrCanceledSubresources() const; |
119 | 122 |
120 static unsigned averageSizeInBytes(); | 123 static unsigned averageSizeInBytes(); |
121 | 124 |
122 #ifndef NDEBUG | 125 #ifndef NDEBUG |
123 void showStyle(); | 126 void showStyle(); |
124 #endif | 127 #endif |
125 | 128 |
126 bool propertyMatches(CSSPropertyID, const CSSValue*) const; | 129 bool propertyMatches(CSSPropertyID, const CSSValue*) const; |
127 | 130 |
128 DECLARE_TRACE(); | 131 DECLARE_TRACE(); |
129 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } | 132 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } |
130 | 133 |
131 protected: | 134 protected: |
132 | 135 |
133 enum { MaxArraySize = (1 << 28) - 1 }; | 136 enum { MaxArraySize = (1 << 27) - 1 }; |
134 | 137 |
135 StylePropertySet(CSSParserMode cssParserMode) | 138 StylePropertySet(CSSParserMode cssParserMode) |
136 : m_cssParserMode(cssParserMode) | 139 : m_cssParserMode(cssParserMode) |
137 , m_isMutable(true) | 140 , m_isMutable(true) |
141 , m_forceOverride(false) | |
138 , m_arraySize(0) | 142 , m_arraySize(0) |
139 { } | 143 { } |
140 | 144 |
141 StylePropertySet(CSSParserMode cssParserMode, unsigned immutableArraySize) | 145 StylePropertySet(CSSParserMode cssParserMode, unsigned immutableArraySize) |
142 : m_cssParserMode(cssParserMode) | 146 : m_cssParserMode(cssParserMode) |
143 , m_isMutable(false) | 147 , m_isMutable(false) |
148 , m_forceOverride(false) | |
144 , m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize))) | 149 , m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize))) |
145 { } | 150 { } |
146 | 151 |
147 unsigned m_cssParserMode : 3; | 152 unsigned m_cssParserMode : 3; |
148 mutable unsigned m_isMutable : 1; | 153 mutable unsigned m_isMutable : 1; |
149 unsigned m_arraySize : 28; | 154 mutable unsigned m_forceOverride : 1; |
155 unsigned m_arraySize : 27; | |
150 | 156 |
151 friend class PropertySetCSSStyleDeclaration; | 157 friend class PropertySetCSSStyleDeclaration; |
152 }; | 158 }; |
153 | 159 |
154 class ImmutableStylePropertySet : public StylePropertySet { | 160 class ImmutableStylePropertySet : public StylePropertySet { |
155 public: | 161 public: |
156 ~ImmutableStylePropertySet(); | 162 ~ImmutableStylePropertySet(); |
157 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> create(const CSSPro perty* properties, unsigned count, CSSParserMode); | 163 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> create(const CSSPro perty* properties, unsigned count, CSSParserMode); |
158 | 164 |
159 unsigned propertyCount() const { return m_arraySize; } | 165 unsigned propertyCount() const { return m_arraySize; } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const | 304 inline int StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const |
299 { | 305 { |
300 if (m_isMutable) | 306 if (m_isMutable) |
301 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); | 307 return toMutableStylePropertySet(this)->findPropertyIndex(propertyID); |
302 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); | 308 return toImmutableStylePropertySet(this)->findPropertyIndex(propertyID); |
303 } | 309 } |
304 | 310 |
305 } // namespace blink | 311 } // namespace blink |
306 | 312 |
307 #endif // StylePropertySet_h | 313 #endif // StylePropertySet_h |
OLD | NEW |