Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: Source/core/dom/ElementRareData.h

Issue 177063004: Move custom element definitions into ElementRareData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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/shadow/ElementShadow.h" 31 #include "core/dom/shadow/ElementShadow.h"
31 #include "core/html/ClassList.h" 32 #include "core/html/ClassList.h"
32 #include "core/html/ime/InputMethodContext.h" 33 #include "core/html/ime/InputMethodContext.h"
33 #include "core/rendering/style/StyleInheritedData.h" 34 #include "core/rendering/style/StyleInheritedData.h"
34 #include "wtf/OwnPtr.h" 35 #include "wtf/OwnPtr.h"
35 36
36 namespace WebCore { 37 namespace WebCore {
37 38
38 class HTMLElement; 39 class HTMLElement;
39 40
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 InputMethodContext* ensureInputMethodContext(HTMLElement* element) 141 InputMethodContext* ensureInputMethodContext(HTMLElement* element)
141 { 142 {
142 if (!m_inputMethodContext) 143 if (!m_inputMethodContext)
143 m_inputMethodContext = InputMethodContext::create(element); 144 m_inputMethodContext = InputMethodContext::create(element);
144 return m_inputMethodContext.get(); 145 return m_inputMethodContext.get();
145 } 146 }
146 147
147 bool hasPseudoElements() const; 148 bool hasPseudoElements() const;
148 void clearPseudoElements(); 149 void clearPseudoElements();
149 150
151 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti on) { m_customElementDefinition = definition; }
152 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); }
153
150 private: 154 private:
151 short m_tabIndex; 155 short m_tabIndex;
152 unsigned short m_childIndex; 156 unsigned short m_childIndex;
153 unsigned m_tabIndexWasSetExplicitly : 1; 157 unsigned m_tabIndexWasSetExplicitly : 1;
154 unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1; 158 unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
155 unsigned m_styleAffectedByEmpty : 1; 159 unsigned m_styleAffectedByEmpty : 1;
156 unsigned m_isInCanvasSubtree : 1; 160 unsigned m_isInCanvasSubtree : 1;
157 unsigned m_containsFullScreenElement : 1; 161 unsigned m_containsFullScreenElement : 1;
158 unsigned m_isInTopLayer : 1; 162 unsigned m_isInTopLayer : 1;
159 unsigned m_hasPendingResources : 1; 163 unsigned m_hasPendingResources : 1;
(...skipping 19 matching lines...) Expand all
179 OwnPtr<ElementShadow> m_shadow; 183 OwnPtr<ElementShadow> m_shadow;
180 OwnPtr<NamedNodeMap> m_attributeMap; 184 OwnPtr<NamedNodeMap> m_attributeMap;
181 OwnPtr<InputMethodContext> m_inputMethodContext; 185 OwnPtr<InputMethodContext> m_inputMethodContext;
182 OwnPtr<ActiveAnimations> m_activeAnimations; 186 OwnPtr<ActiveAnimations> m_activeAnimations;
183 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; 187 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper;
184 188
185 RefPtr<PseudoElement> m_generatedBefore; 189 RefPtr<PseudoElement> m_generatedBefore;
186 RefPtr<PseudoElement> m_generatedAfter; 190 RefPtr<PseudoElement> m_generatedAfter;
187 RefPtr<PseudoElement> m_backdrop; 191 RefPtr<PseudoElement> m_backdrop;
188 192
189 ElementRareData(RenderObject*); 193 RefPtr<CustomElementDefinition> m_customElementDefinition;
194
195 explicit ElementRareData(RenderObject*);
190 }; 196 };
191 197
192 inline IntSize defaultMinimumSizeForResizing() 198 inline IntSize defaultMinimumSizeForResizing()
193 { 199 {
194 return IntSize(LayoutUnit::max(), LayoutUnit::max()); 200 return IntSize(LayoutUnit::max(), LayoutUnit::max());
195 } 201 }
196 202
197 inline ElementRareData::ElementRareData(RenderObject* renderer) 203 inline ElementRareData::ElementRareData(RenderObject* renderer)
198 : NodeRareData(renderer) 204 : NodeRareData(renderer)
199 , m_tabIndex(0) 205 , m_tabIndex(0)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 setChildrenAffectedByFirstChildRules(false); 296 setChildrenAffectedByFirstChildRules(false);
291 setChildrenAffectedByLastChildRules(false); 297 setChildrenAffectedByLastChildRules(false);
292 setChildrenAffectedByDirectAdjacentRules(false); 298 setChildrenAffectedByDirectAdjacentRules(false);
293 setChildrenAffectedByForwardPositionalRules(false); 299 setChildrenAffectedByForwardPositionalRules(false);
294 setChildrenAffectedByBackwardPositionalRules(false); 300 setChildrenAffectedByBackwardPositionalRules(false);
295 } 301 }
296 302
297 } // namespace 303 } // namespace
298 304
299 #endif // ElementRareData_h 305 #endif // ElementRareData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698