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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 * | 19 * |
20 */ | 20 */ |
21 | 21 |
22 #ifndef ElementRareData_h | 22 #ifndef ElementRareData_h |
23 #define ElementRareData_h | 23 #define ElementRareData_h |
24 | 24 |
25 #include "core/animation/ActiveAnimations.h" | 25 #include "core/animation/ActiveAnimations.h" |
26 #include "core/dom/Attr.h" | |
27 #include "core/dom/NamedNodeMap.h" | |
28 #include "core/dom/NodeRareData.h" | 26 #include "core/dom/NodeRareData.h" |
29 #include "core/dom/custom/CustomElementDefinition.h" | 27 #include "core/dom/custom/CustomElementDefinition.h" |
30 #include "core/dom/shadow/ElementShadow.h" | 28 #include "core/dom/shadow/ElementShadow.h" |
31 #include "core/html/ClassList.h" | 29 #include "core/html/ClassList.h" |
32 #include "core/html/ime/InputMethodContext.h" | 30 #include "core/html/ime/InputMethodContext.h" |
33 #include "core/rendering/style/StyleInheritedData.h" | 31 #include "core/rendering/style/StyleInheritedData.h" |
34 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
35 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
36 | 34 |
37 namespace blink { | 35 namespace blink { |
(...skipping 27 matching lines...) Expand all Loading... |
65 | 63 |
66 void clearShadow() { m_shadow = nullptr; } | 64 void clearShadow() { m_shadow = nullptr; } |
67 ElementShadow* shadow() const { return m_shadow.get(); } | 65 ElementShadow* shadow() const { return m_shadow.get(); } |
68 ElementShadow& ensureShadow() | 66 ElementShadow& ensureShadow() |
69 { | 67 { |
70 if (!m_shadow) | 68 if (!m_shadow) |
71 m_shadow = ElementShadow::create(); | 69 m_shadow = ElementShadow::create(); |
72 return *m_shadow; | 70 return *m_shadow; |
73 } | 71 } |
74 | 72 |
75 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); } | |
76 void setAttributeMap(PassOwnPtr<NamedNodeMap> attributeMap) { m_attributeMap
= attributeMap; } | |
77 | |
78 RenderStyle* computedStyle() const { return m_computedStyle.get(); } | 73 RenderStyle* computedStyle() const { return m_computedStyle.get(); } |
79 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } | 74 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } |
80 void clearComputedStyle() { m_computedStyle = nullptr; } | 75 void clearComputedStyle() { m_computedStyle = nullptr; } |
81 | 76 |
82 ClassList* classList() const { return m_classList.get(); } | 77 ClassList* classList() const { return m_classList.get(); } |
83 void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList
; } | 78 void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList
; } |
84 | 79 |
85 LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing;
} | 80 LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing;
} |
86 void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing =
size; } | 81 void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing =
size; } |
87 | 82 |
(...skipping 10 matching lines...) Expand all Loading... |
98 InputMethodContext& ensureInputMethodContext(HTMLElement* element) | 93 InputMethodContext& ensureInputMethodContext(HTMLElement* element) |
99 { | 94 { |
100 if (!m_inputMethodContext) | 95 if (!m_inputMethodContext) |
101 m_inputMethodContext = InputMethodContext::create(element); | 96 m_inputMethodContext = InputMethodContext::create(element); |
102 return *m_inputMethodContext; | 97 return *m_inputMethodContext; |
103 } | 98 } |
104 | 99 |
105 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } | 100 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } |
106 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 101 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
107 | 102 |
108 Vector<RefPtr<Attr> >& ensureAttrNodeList(); | |
109 Vector<RefPtr<Attr> >* attrNodeList() { return m_attrNodeList.get(); } | |
110 void removeAttrNodeList() { m_attrNodeList.clear(); } | |
111 | |
112 void traceAfterDispatch(Visitor*); | 103 void traceAfterDispatch(Visitor*); |
113 | 104 |
114 private: | 105 private: |
115 short m_tabindex; | 106 short m_tabindex; |
116 | 107 |
117 LayoutSize m_minimumSizeForResizing; | 108 LayoutSize m_minimumSizeForResizing; |
118 IntSize m_savedLayerScrollOffset; | 109 IntSize m_savedLayerScrollOffset; |
119 | 110 |
120 OwnPtr<ClassList> m_classList; | 111 OwnPtr<ClassList> m_classList; |
121 OwnPtr<ElementShadow> m_shadow; | 112 OwnPtr<ElementShadow> m_shadow; |
122 OwnPtr<NamedNodeMap> m_attributeMap; | |
123 OwnPtr<Vector<RefPtr<Attr> > > m_attrNodeList; | |
124 OwnPtr<InputMethodContext> m_inputMethodContext; | 113 OwnPtr<InputMethodContext> m_inputMethodContext; |
125 OwnPtr<ActiveAnimations> m_activeAnimations; | 114 OwnPtr<ActiveAnimations> m_activeAnimations; |
126 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 115 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
127 | 116 |
128 RefPtr<RenderStyle> m_computedStyle; | 117 RefPtr<RenderStyle> m_computedStyle; |
129 RefPtr<CustomElementDefinition> m_customElementDefinition; | 118 RefPtr<CustomElementDefinition> m_customElementDefinition; |
130 | 119 |
131 explicit ElementRareData(RenderObject*); | 120 explicit ElementRareData(RenderObject*); |
132 }; | 121 }; |
133 | 122 |
(...skipping 13 matching lines...) Expand all Loading... |
147 inline ElementRareData::~ElementRareData() | 136 inline ElementRareData::~ElementRareData() |
148 { | 137 { |
149 #if !ENABLE(OILPAN) | 138 #if !ENABLE(OILPAN) |
150 ASSERT(!m_shadow); | 139 ASSERT(!m_shadow); |
151 #endif | 140 #endif |
152 } | 141 } |
153 | 142 |
154 } // namespace | 143 } // namespace |
155 | 144 |
156 #endif // ElementRareData_h | 145 #endif // ElementRareData_h |
OLD | NEW |