OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/dom/ElementData.h" | 32 #include "core/dom/ElementData.h" |
33 | 33 |
34 #include "core/css/StylePropertySet.h" | 34 #include "core/css/StylePropertySet.h" |
35 #include "core/dom/QualifiedName.h" | 35 #include "core/dom/QualifiedName.h" |
| 36 #include "wtf/SizeAssertions.h" |
36 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 struct SameSizeAsElementData : public RefCountedWillBeGarbageCollectedFinalized<
SameSizeAsElementData> { | 41 ASSERT_SIZE(ElementData, 20, 32); |
41 unsigned bitfield; | |
42 void* pointers[3]; | |
43 }; | |
44 | |
45 static_assert(sizeof(ElementData) == sizeof(SameSizeAsElementData), "ElementData
should stay small"); | |
46 | 42 |
47 static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) | 43 static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) |
48 { | 44 { |
49 return sizeof(ShareableElementData) + sizeof(Attribute) * count; | 45 return sizeof(ShareableElementData) + sizeof(Attribute) * count; |
50 } | 46 } |
51 | 47 |
52 ElementData::ElementData() | 48 ElementData::ElementData() |
53 : m_isUnique(true) | 49 : m_isUnique(true) |
54 , m_arraySize(0) | 50 , m_arraySize(0) |
55 , m_presentationAttributeStyleIsDirty(false) | 51 , m_presentationAttributeStyleIsDirty(false) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this)); | 207 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this)); |
212 } | 208 } |
213 | 209 |
214 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) | 210 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) |
215 { | 211 { |
216 visitor->trace(m_presentationAttributeStyle); | 212 visitor->trace(m_presentationAttributeStyle); |
217 ElementData::traceAfterDispatch(visitor); | 213 ElementData::traceAfterDispatch(visitor); |
218 } | 214 } |
219 | 215 |
220 } // namespace blink | 216 } // namespace blink |
OLD | NEW |