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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 ~ElementRareData(); | 50 ~ElementRareData(); |
51 | 51 |
52 void setPseudoElement(PseudoId, PassRefPtrWillBeRawPtr<PseudoElement>); | 52 void setPseudoElement(PseudoId, PassRefPtrWillBeRawPtr<PseudoElement>); |
53 PseudoElement* pseudoElement(PseudoId) const; | 53 PseudoElement* pseudoElement(PseudoId) const; |
54 | 54 |
55 short tabIndex() const { return m_tabindex; } | 55 short tabIndex() const { return m_tabindex; } |
56 | 56 |
57 void setTabIndexExplicitly(short index) | 57 void setTabIndexExplicitly(short index) |
58 { | 58 { |
59 m_tabindex = index; | 59 m_tabindex = index; |
| 60 // isTabStop is overridden by setting tabindex. |
| 61 m_isTabStop = (m_tabindex >= 0); |
60 setElementFlag(TabIndexWasSetExplicitly, true); | 62 setElementFlag(TabIndexWasSetExplicitly, true); |
61 } | 63 } |
62 | 64 |
63 void clearTabIndexExplicitly() | 65 void clearTabIndexExplicitly() |
64 { | 66 { |
65 m_tabindex = 0; | 67 m_tabindex = 0; |
| 68 m_isTabStop = true; |
66 clearElementFlag(TabIndexWasSetExplicitly); | 69 clearElementFlag(TabIndexWasSetExplicitly); |
67 } | 70 } |
68 | 71 |
| 72 bool isTabStop() const { return m_isTabStop; } |
| 73 |
| 74 void setIsTabStop(bool flag) { m_isTabStop = flag; } |
| 75 |
69 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); | 76 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); |
70 | 77 |
71 void clearShadow() { m_shadow = nullptr; } | 78 void clearShadow() { m_shadow = nullptr; } |
72 ElementShadow* shadow() const { return m_shadow.get(); } | 79 ElementShadow* shadow() const { return m_shadow.get(); } |
73 ElementShadow& ensureShadow() | 80 ElementShadow& ensureShadow() |
74 { | 81 { |
75 if (!m_shadow) | 82 if (!m_shadow) |
76 m_shadow = ElementShadow::create(); | 83 m_shadow = ElementShadow::create(); |
77 return *m_shadow; | 84 return *m_shadow; |
78 } | 85 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 130 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
124 | 131 |
125 WillBeHeapVector<RefPtrWillBeMember<Attr> >& ensureAttrNodeList(); | 132 WillBeHeapVector<RefPtrWillBeMember<Attr> >& ensureAttrNodeList(); |
126 WillBeHeapVector<RefPtrWillBeMember<Attr> >* attrNodeList() { return m_attrN
odeList.get(); } | 133 WillBeHeapVector<RefPtrWillBeMember<Attr> >* attrNodeList() { return m_attrN
odeList.get(); } |
127 void removeAttrNodeList() { m_attrNodeList.clear(); } | 134 void removeAttrNodeList() { m_attrNodeList.clear(); } |
128 | 135 |
129 void traceAfterDispatch(Visitor*); | 136 void traceAfterDispatch(Visitor*); |
130 | 137 |
131 private: | 138 private: |
132 short m_tabindex; | 139 short m_tabindex; |
| 140 bool m_isTabStop; |
133 | 141 |
134 LayoutSize m_minimumSizeForResizing; | 142 LayoutSize m_minimumSizeForResizing; |
135 IntSize m_savedLayerScrollOffset; | 143 IntSize m_savedLayerScrollOffset; |
136 | 144 |
137 OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset; | 145 OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset; |
138 OwnPtrWillBeMember<ClassList> m_classList; | 146 OwnPtrWillBeMember<ClassList> m_classList; |
139 OwnPtrWillBeMember<ElementShadow> m_shadow; | 147 OwnPtrWillBeMember<ElementShadow> m_shadow; |
140 OwnPtrWillBeMember<NamedNodeMap> m_attributeMap; | 148 OwnPtrWillBeMember<NamedNodeMap> m_attributeMap; |
141 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Attr> > > m_attrNodeL
ist; | 149 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Attr> > > m_attrNodeL
ist; |
142 OwnPtrWillBeMember<InputMethodContext> m_inputMethodContext; | 150 OwnPtrWillBeMember<InputMethodContext> m_inputMethodContext; |
(...skipping 12 matching lines...) Expand all Loading... |
155 }; | 163 }; |
156 | 164 |
157 inline LayoutSize defaultMinimumSizeForResizing() | 165 inline LayoutSize defaultMinimumSizeForResizing() |
158 { | 166 { |
159 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); | 167 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); |
160 } | 168 } |
161 | 169 |
162 inline ElementRareData::ElementRareData(LayoutObject* renderer) | 170 inline ElementRareData::ElementRareData(LayoutObject* renderer) |
163 : NodeRareData(renderer) | 171 : NodeRareData(renderer) |
164 , m_tabindex(0) | 172 , m_tabindex(0) |
| 173 , m_isTabStop(true) |
165 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) | 174 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) |
166 { | 175 { |
167 m_isElementRareData = true; | 176 m_isElementRareData = true; |
168 } | 177 } |
169 | 178 |
170 inline ElementRareData::~ElementRareData() | 179 inline ElementRareData::~ElementRareData() |
171 { | 180 { |
172 #if !ENABLE(OILPAN) | 181 #if !ENABLE(OILPAN) |
173 ASSERT(!m_shadow); | 182 ASSERT(!m_shadow); |
174 #endif | 183 #endif |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 case FIRST_LETTER: | 240 case FIRST_LETTER: |
232 return m_generatedFirstLetter.get(); | 241 return m_generatedFirstLetter.get(); |
233 default: | 242 default: |
234 return 0; | 243 return 0; |
235 } | 244 } |
236 } | 245 } |
237 | 246 |
238 } // namespace | 247 } // namespace |
239 | 248 |
240 #endif // ElementRareData_h | 249 #endif // ElementRareData_h |
OLD | NEW |