OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void deref(); | 59 void deref(); |
60 #endif | 60 #endif |
61 | 61 |
62 void clearClass() const { m_classNames.clear(); } | 62 void clearClass() const { m_classNames.clear(); } |
63 void setClass(const AtomicString& className, bool shouldFoldCase) const { m_
classNames.set(className, shouldFoldCase ? SpaceSplitString::ShouldFoldCase : Sp
aceSplitString::ShouldNotFoldCase); } | 63 void setClass(const AtomicString& className, bool shouldFoldCase) const { m_
classNames.set(className, shouldFoldCase ? SpaceSplitString::ShouldFoldCase : Sp
aceSplitString::ShouldNotFoldCase); } |
64 const SpaceSplitString& classNames() const { return m_classNames; } | 64 const SpaceSplitString& classNames() const { return m_classNames; } |
65 | 65 |
66 const AtomicString& idForStyleResolution() const { return m_idForStyleResolu
tion; } | 66 const AtomicString& idForStyleResolution() const { return m_idForStyleResolu
tion; } |
67 void setIdForStyleResolution(const AtomicString& newId) const { m_idForStyle
Resolution = newId; } | 67 void setIdForStyleResolution(const AtomicString& newId) const { m_idForStyle
Resolution = newId; } |
68 | 68 |
69 const StylePropertySet* inlineStyle() const { return m_inlineStyle.get(); } | 69 const StylePropertySet* inlineStyle() const; |
70 | 70 |
71 const StylePropertySet* presentationAttributeStyle() const; | 71 const StylePropertySet* presentationAttributeStyle() const; |
72 | 72 |
73 AttributeCollection attributes() const; | 73 AttributeCollection attributes() const; |
74 | 74 |
75 bool hasID() const { return !m_idForStyleResolution.isNull(); } | 75 bool hasID() const { return !m_idForStyleResolution.isNull(); } |
76 bool hasClass() const { return !m_classNames.isNull(); } | 76 bool hasClass() const { return !m_classNames.isNull(); } |
77 | 77 |
78 bool isEquivalent(const ElementData* other) const; | 78 bool isEquivalent(const ElementData* other) const; |
79 | 79 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 #if !ENABLE(OILPAN) | 188 #if !ENABLE(OILPAN) |
189 inline void ElementData::deref() | 189 inline void ElementData::deref() |
190 { | 190 { |
191 if (!derefBase()) | 191 if (!derefBase()) |
192 return; | 192 return; |
193 destroy(); | 193 destroy(); |
194 } | 194 } |
195 #endif | 195 #endif |
196 | 196 |
197 inline const StylePropertySet* ElementData::presentationAttributeStyle() const | |
198 { | |
199 if (!m_isUnique) | |
200 return 0; | |
201 return toUniqueElementData(this)->m_presentationAttributeStyle.get(); | |
202 } | |
203 | |
204 inline AttributeCollection ElementData::attributes() const | 197 inline AttributeCollection ElementData::attributes() const |
205 { | 198 { |
206 if (isUnique()) | 199 if (isUnique()) |
207 return toUniqueElementData(this)->attributes(); | 200 return toUniqueElementData(this)->attributes(); |
208 return toShareableElementData(this)->attributes(); | 201 return toShareableElementData(this)->attributes(); |
209 } | 202 } |
210 | 203 |
211 inline AttributeCollection ShareableElementData::attributes() const | 204 inline AttributeCollection ShareableElementData::attributes() const |
212 { | 205 { |
213 return AttributeCollection(m_attributeArray, m_arraySize); | 206 return AttributeCollection(m_attributeArray, m_arraySize); |
214 } | 207 } |
215 | 208 |
216 inline AttributeCollection UniqueElementData::attributes() const | 209 inline AttributeCollection UniqueElementData::attributes() const |
217 { | 210 { |
218 return AttributeCollection(m_attributeVector.data(), m_attributeVector.size(
)); | 211 return AttributeCollection(m_attributeVector.data(), m_attributeVector.size(
)); |
219 } | 212 } |
220 | 213 |
221 inline MutableAttributeCollection UniqueElementData::attributes() | 214 inline MutableAttributeCollection UniqueElementData::attributes() |
222 { | 215 { |
223 return MutableAttributeCollection(m_attributeVector); | 216 return MutableAttributeCollection(m_attributeVector); |
224 } | 217 } |
225 | 218 |
226 } // namespace blink | 219 } // namespace blink |
227 | 220 |
228 #endif // ElementData_h | 221 #endif // ElementData_h |
OLD | NEW |