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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 m_tabindex = index; | 56 m_tabindex = index; |
57 setFlag(TabIndexWasSetExplicitly, true); | 57 setFlag(TabIndexWasSetExplicitly, true); |
58 } | 58 } |
59 | 59 |
60 void clearTabIndexExplicitly() | 60 void clearTabIndexExplicitly() |
61 { | 61 { |
62 m_tabindex = 0; | 62 m_tabindex = 0; |
63 clearFlag(TabIndexWasSetExplicitly); | 63 clearFlag(TabIndexWasSetExplicitly); |
64 } | 64 } |
65 | 65 |
66 bool hasFlag(ElementFlags mask) const { return m_flags & mask; } | |
67 void setFlag(ElementFlags mask, bool value) { m_flags = (m_flags & ~mask) |
(-(int32_t)value & mask); } | |
68 void clearFlag(ElementFlags mask) { m_flags &= ~mask; } | |
69 | |
70 unsigned childIndex() const { return m_childIndex; } | 66 unsigned childIndex() const { return m_childIndex; } |
71 void setChildIndex(unsigned index) { m_childIndex = index; } | 67 void setChildIndex(unsigned index) { m_childIndex = index; } |
72 | 68 |
73 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); | 69 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); |
74 | 70 |
75 void clearShadow() { m_shadow = nullptr; } | 71 void clearShadow() { m_shadow = nullptr; } |
76 ElementShadow* shadow() const { return m_shadow.get(); } | 72 ElementShadow* shadow() const { return m_shadow.get(); } |
77 ElementShadow& ensureShadow() | 73 ElementShadow& ensureShadow() |
78 { | 74 { |
79 if (!m_shadow) | 75 if (!m_shadow) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 m_inputMethodContext = InputMethodContext::create(element); | 115 m_inputMethodContext = InputMethodContext::create(element); |
120 return *m_inputMethodContext; | 116 return *m_inputMethodContext; |
121 } | 117 } |
122 | 118 |
123 bool hasPseudoElements() const; | 119 bool hasPseudoElements() const; |
124 void clearPseudoElements(); | 120 void clearPseudoElements(); |
125 | 121 |
126 private: | 122 private: |
127 short m_tabindex; | 123 short m_tabindex; |
128 unsigned short m_childIndex; | 124 unsigned short m_childIndex; |
129 unsigned m_flags; | |
130 | 125 |
131 LayoutSize m_minimumSizeForResizing; | 126 LayoutSize m_minimumSizeForResizing; |
132 IntSize m_savedLayerScrollOffset; | 127 IntSize m_savedLayerScrollOffset; |
133 RefPtr<RenderStyle> m_computedStyle; | 128 RefPtr<RenderStyle> m_computedStyle; |
134 | 129 |
135 OwnPtr<DatasetDOMStringMap> m_dataset; | 130 OwnPtr<DatasetDOMStringMap> m_dataset; |
136 OwnPtr<ClassList> m_classList; | 131 OwnPtr<ClassList> m_classList; |
137 OwnPtr<ElementShadow> m_shadow; | 132 OwnPtr<ElementShadow> m_shadow; |
138 OwnPtr<NamedNodeMap> m_attributeMap; | 133 OwnPtr<NamedNodeMap> m_attributeMap; |
139 OwnPtr<InputMethodContext> m_inputMethodContext; | 134 OwnPtr<InputMethodContext> m_inputMethodContext; |
140 OwnPtr<ActiveAnimations> m_activeAnimations; | 135 OwnPtr<ActiveAnimations> m_activeAnimations; |
141 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 136 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
142 | 137 |
143 RefPtr<PseudoElement> m_generatedBefore; | 138 RefPtr<PseudoElement> m_generatedBefore; |
144 RefPtr<PseudoElement> m_generatedAfter; | 139 RefPtr<PseudoElement> m_generatedAfter; |
145 RefPtr<PseudoElement> m_backdrop; | 140 RefPtr<PseudoElement> m_backdrop; |
146 | 141 |
147 explicit ElementRareData(RenderObject*); | 142 explicit ElementRareData(RenderObject*); |
148 }; | 143 }; |
149 | 144 |
150 inline IntSize defaultMinimumSizeForResizing() | 145 inline IntSize defaultMinimumSizeForResizing() |
151 { | 146 { |
152 return IntSize(LayoutUnit::max(), LayoutUnit::max()); | 147 return IntSize(LayoutUnit::max(), LayoutUnit::max()); |
153 } | 148 } |
154 | 149 |
155 inline ElementRareData::ElementRareData(RenderObject* renderer) | 150 inline ElementRareData::ElementRareData(RenderObject* renderer) |
156 : NodeRareData(renderer) | 151 : NodeRareData(renderer) |
157 , m_tabindex(0) | 152 , m_tabindex(0) |
158 , m_childIndex(0) | 153 , m_childIndex(0) |
159 , m_flags(0) | |
160 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) | 154 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) |
161 { | 155 { |
162 } | 156 } |
163 | 157 |
164 inline ElementRareData::~ElementRareData() | 158 inline ElementRareData::~ElementRareData() |
165 { | 159 { |
166 ASSERT(!m_shadow); | 160 ASSERT(!m_shadow); |
167 ASSERT(!m_generatedBefore); | 161 ASSERT(!m_generatedBefore); |
168 ASSERT(!m_generatedAfter); | 162 ASSERT(!m_generatedAfter); |
169 ASSERT(!m_backdrop); | 163 ASSERT(!m_backdrop); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 clearFlag(ChildrenAffectedByLastChildRules); | 228 clearFlag(ChildrenAffectedByLastChildRules); |
235 clearFlag(ChildrenAffectedByDirectAdjacentRules); | 229 clearFlag(ChildrenAffectedByDirectAdjacentRules); |
236 clearFlag(ChildrenAffectedByIndirectAdjacentRules); | 230 clearFlag(ChildrenAffectedByIndirectAdjacentRules); |
237 clearFlag(ChildrenAffectedByForwardPositionalRules); | 231 clearFlag(ChildrenAffectedByForwardPositionalRules); |
238 clearFlag(ChildrenAffectedByBackwardPositionalRules); | 232 clearFlag(ChildrenAffectedByBackwardPositionalRules); |
239 } | 233 } |
240 | 234 |
241 } // namespace | 235 } // namespace |
242 | 236 |
243 #endif // ElementRareData_h | 237 #endif // ElementRareData_h |
OLD | NEW |