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...) Expand all 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 RawPtr<ElementRareData> create(RenderObject* renderer) |
haraken
2014/05/07 02:10:26
This could be ElementRareData*.
| |
44 { | 45 { |
45 return adoptPtr(new ElementRareData(renderer)); | 46 return 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 m_inputMethodContext = InputMethodContext::create(element); | 113 m_inputMethodContext = InputMethodContext::create(element); |
113 return *m_inputMethodContext; | 114 return *m_inputMethodContext; |
114 } | 115 } |
115 | 116 |
116 bool hasPseudoElements() const; | 117 bool hasPseudoElements() const; |
117 void clearPseudoElements(); | 118 void clearPseudoElements(); |
118 | 119 |
119 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti on) { m_customElementDefinition = definition; } | 120 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti on) { m_customElementDefinition = definition; } |
120 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); } | 121 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); } |
121 | 122 |
122 void trace(Visitor* visitor) | 123 void traceAfterDispatch(Visitor*); |
123 { | |
124 // FIXME: Oilpan: Implement real tracing of the | |
125 // ElementRareData when it has been moved to the | |
126 // oilpan heap and move the ElementShadow tracing | |
127 // to the ElementShadow when that has been moved | |
128 // to the oilpan heap. | |
129 visitor->trace(m_shadow); | |
130 } | |
131 | 124 |
132 private: | 125 private: |
133 short m_tabindex; | 126 short m_tabindex; |
134 | 127 |
135 IntSize m_savedLayerScrollOffset; | 128 IntSize m_savedLayerScrollOffset; |
136 | 129 |
137 OwnPtr<DatasetDOMStringMap> m_dataset; | 130 OwnPtr<DatasetDOMStringMap> m_dataset; |
138 OwnPtr<ClassList> m_classList; | 131 OwnPtr<ClassList> m_classList; |
139 OwnPtr<ElementShadow> m_shadow; | 132 OwnPtrWillBeMember<ElementShadow> m_shadow; |
140 OwnPtr<NamedNodeMap> m_attributeMap; | 133 OwnPtr<NamedNodeMap> m_attributeMap; |
141 OwnPtr<InputMethodContext> m_inputMethodContext; | 134 OwnPtr<InputMethodContext> m_inputMethodContext; |
142 OwnPtrWillBePersistent<ActiveAnimations> m_activeAnimations; | 135 OwnPtrWillBeMember<ActiveAnimations> m_activeAnimations; |
143 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 136 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
144 | 137 |
145 RefPtr<RenderStyle> m_computedStyle; | 138 RefPtr<RenderStyle> m_computedStyle; |
146 RefPtr<CustomElementDefinition> m_customElementDefinition; | 139 RefPtr<CustomElementDefinition> m_customElementDefinition; |
147 | 140 |
148 RefPtr<PseudoElement> m_generatedBefore; | 141 RefPtr<PseudoElement> m_generatedBefore; |
149 RefPtr<PseudoElement> m_generatedAfter; | 142 RefPtr<PseudoElement> m_generatedAfter; |
150 RefPtr<PseudoElement> m_backdrop; | 143 RefPtr<PseudoElement> m_backdrop; |
151 | 144 |
152 explicit ElementRareData(RenderObject*); | 145 explicit ElementRareData(RenderObject*); |
153 }; | 146 }; |
154 | 147 |
155 inline ElementRareData::ElementRareData(RenderObject* renderer) | 148 inline ElementRareData::ElementRareData(RenderObject* renderer) |
156 : NodeRareData(renderer) | 149 : NodeRareData(renderer) |
157 , m_tabindex(0) | 150 , m_tabindex(0) |
158 { | 151 { |
152 m_isElementRareData = true; | |
159 } | 153 } |
160 | 154 |
161 inline ElementRareData::~ElementRareData() | 155 inline ElementRareData::~ElementRareData() |
162 { | 156 { |
157 #if !ENABLE(OILPAN) | |
163 ASSERT(!m_shadow); | 158 ASSERT(!m_shadow); |
159 #endif | |
164 ASSERT(!m_generatedBefore); | 160 ASSERT(!m_generatedBefore); |
165 ASSERT(!m_generatedAfter); | 161 ASSERT(!m_generatedAfter); |
166 ASSERT(!m_backdrop); | 162 ASSERT(!m_backdrop); |
167 } | 163 } |
168 | 164 |
169 inline bool ElementRareData::hasPseudoElements() const | 165 inline bool ElementRareData::hasPseudoElements() const |
170 { | 166 { |
171 return m_generatedBefore || m_generatedAfter || m_backdrop; | 167 return m_generatedBefore || m_generatedAfter || m_backdrop; |
172 } | 168 } |
173 | 169 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 } | 212 } |
217 | 213 |
218 inline void ElementRareData::resetStyleState() | 214 inline void ElementRareData::resetStyleState() |
219 { | 215 { |
220 clearElementFlag(StyleAffectedByEmpty); | 216 clearElementFlag(StyleAffectedByEmpty); |
221 } | 217 } |
222 | 218 |
223 } // namespace | 219 } // namespace |
224 | 220 |
225 #endif // ElementRareData_h | 221 #endif // ElementRareData_h |
OLD | NEW |