OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
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 14 matching lines...) Loading... |
25 #include "core/animation/ActiveAnimations.h" | 25 #include "core/animation/ActiveAnimations.h" |
26 #include "core/dom/DatasetDOMStringMap.h" | 26 #include "core/dom/DatasetDOMStringMap.h" |
27 #include "core/dom/NamedNodeMap.h" | 27 #include "core/dom/NamedNodeMap.h" |
28 #include "core/dom/NodeRareData.h" | 28 #include "core/dom/NodeRareData.h" |
29 #include "core/dom/PseudoElement.h" | 29 #include "core/dom/PseudoElement.h" |
30 #include "core/dom/custom/CustomElementDefinition.h" | 30 #include "core/dom/custom/CustomElementDefinition.h" |
31 #include "core/dom/shadow/ElementShadow.h" | 31 #include "core/dom/shadow/ElementShadow.h" |
32 #include "core/html/ClassList.h" | 32 #include "core/html/ClassList.h" |
33 #include "core/html/ime/InputMethodContext.h" | 33 #include "core/html/ime/InputMethodContext.h" |
34 #include "core/rendering/style/StyleInheritedData.h" | 34 #include "core/rendering/style/StyleInheritedData.h" |
| 35 #include "platform/heap/Handle.h" |
35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
36 | 37 |
37 namespace WebCore { | 38 namespace WebCore { |
38 | 39 |
39 class HTMLElement; | 40 class HTMLElement; |
40 | 41 |
41 class ElementRareData : public NodeRareData { | 42 class ElementRareData : public NodeRareData { |
42 public: | 43 public: |
43 static PassOwnPtr<ElementRareData> create(RenderObject* renderer) | 44 static PassOwnPtrWillBeRawPtr<ElementRareData> create(RenderObject* renderer
) |
44 { | 45 { |
45 return adoptPtr(new ElementRareData(renderer)); | 46 return adoptPtrWillBeNoop(new ElementRareData(renderer)); |
46 } | 47 } |
47 | 48 |
48 ~ElementRareData(); | 49 ~ElementRareData(); |
49 | 50 |
50 void setPseudoElement(PseudoId, PassRefPtr<PseudoElement>); | 51 void setPseudoElement(PseudoId, PassRefPtr<PseudoElement>); |
51 PseudoElement* pseudoElement(PseudoId) const; | 52 PseudoElement* pseudoElement(PseudoId) const; |
52 | 53 |
53 void resetStyleState(); | 54 void resetStyleState(); |
54 | 55 |
55 short tabIndex() const { return m_tabindex; } | 56 short tabIndex() const { return m_tabindex; } |
(...skipping 59 matching lines...) Loading... |
115 m_inputMethodContext = InputMethodContext::create(element); | 116 m_inputMethodContext = InputMethodContext::create(element); |
116 return *m_inputMethodContext; | 117 return *m_inputMethodContext; |
117 } | 118 } |
118 | 119 |
119 bool hasPseudoElements() const; | 120 bool hasPseudoElements() const; |
120 void clearPseudoElements(); | 121 void clearPseudoElements(); |
121 | 122 |
122 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } | 123 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } |
123 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 124 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
124 | 125 |
| 126 void traceAfterDispatch(Visitor*); |
| 127 |
125 private: | 128 private: |
126 short m_tabindex; | 129 short m_tabindex; |
127 | 130 |
128 LayoutSize m_minimumSizeForResizing; | 131 LayoutSize m_minimumSizeForResizing; |
129 IntSize m_savedLayerScrollOffset; | 132 IntSize m_savedLayerScrollOffset; |
130 | 133 |
131 OwnPtr<DatasetDOMStringMap> m_dataset; | 134 OwnPtr<DatasetDOMStringMap> m_dataset; |
132 OwnPtr<ClassList> m_classList; | 135 OwnPtr<ClassList> m_classList; |
133 OwnPtr<ElementShadow> m_shadow; | 136 OwnPtr<ElementShadow> m_shadow; |
134 OwnPtr<NamedNodeMap> m_attributeMap; | 137 OwnPtr<NamedNodeMap> m_attributeMap; |
135 OwnPtr<InputMethodContext> m_inputMethodContext; | 138 OwnPtr<InputMethodContext> m_inputMethodContext; |
136 OwnPtrWillBePersistent<ActiveAnimations> m_activeAnimations; | 139 OwnPtrWillBeMember<ActiveAnimations> m_activeAnimations; |
137 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 140 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
138 | 141 |
139 RefPtr<RenderStyle> m_computedStyle; | 142 RefPtr<RenderStyle> m_computedStyle; |
140 RefPtr<CustomElementDefinition> m_customElementDefinition; | 143 RefPtr<CustomElementDefinition> m_customElementDefinition; |
141 | 144 |
142 RefPtr<PseudoElement> m_generatedBefore; | 145 RefPtr<PseudoElement> m_generatedBefore; |
143 RefPtr<PseudoElement> m_generatedAfter; | 146 RefPtr<PseudoElement> m_generatedAfter; |
144 RefPtr<PseudoElement> m_backdrop; | 147 RefPtr<PseudoElement> m_backdrop; |
145 | 148 |
146 explicit ElementRareData(RenderObject*); | 149 explicit ElementRareData(RenderObject*); |
147 }; | 150 }; |
148 | 151 |
149 inline IntSize defaultMinimumSizeForResizing() | 152 inline IntSize defaultMinimumSizeForResizing() |
150 { | 153 { |
151 return IntSize(LayoutUnit::max(), LayoutUnit::max()); | 154 return IntSize(LayoutUnit::max(), LayoutUnit::max()); |
152 } | 155 } |
153 | 156 |
154 inline ElementRareData::ElementRareData(RenderObject* renderer) | 157 inline ElementRareData::ElementRareData(RenderObject* renderer) |
155 : NodeRareData(renderer) | 158 : NodeRareData(renderer) |
156 , m_tabindex(0) | 159 , m_tabindex(0) |
157 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) | 160 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) |
158 { | 161 { |
| 162 m_isElementRareData = true; |
159 } | 163 } |
160 | 164 |
161 inline ElementRareData::~ElementRareData() | 165 inline ElementRareData::~ElementRareData() |
162 { | 166 { |
| 167 #if !ENABLE(OILPAN) |
163 ASSERT(!m_shadow); | 168 ASSERT(!m_shadow); |
| 169 #endif |
164 ASSERT(!m_generatedBefore); | 170 ASSERT(!m_generatedBefore); |
165 ASSERT(!m_generatedAfter); | 171 ASSERT(!m_generatedAfter); |
166 ASSERT(!m_backdrop); | 172 ASSERT(!m_backdrop); |
167 } | 173 } |
168 | 174 |
169 inline bool ElementRareData::hasPseudoElements() const | 175 inline bool ElementRareData::hasPseudoElements() const |
170 { | 176 { |
171 return m_generatedBefore || m_generatedAfter || m_backdrop; | 177 return m_generatedBefore || m_generatedAfter || m_backdrop; |
172 } | 178 } |
173 | 179 |
(...skipping 42 matching lines...) Loading... |
216 } | 222 } |
217 | 223 |
218 inline void ElementRareData::resetStyleState() | 224 inline void ElementRareData::resetStyleState() |
219 { | 225 { |
220 clearElementFlag(StyleAffectedByEmpty); | 226 clearElementFlag(StyleAffectedByEmpty); |
221 } | 227 } |
222 | 228 |
223 } // namespace | 229 } // namespace |
224 | 230 |
225 #endif // ElementRareData_h | 231 #endif // ElementRareData_h |
OLD | NEW |