Chromium Code Reviews| 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/ElementAnimations.h" | 25 #include "core/animation/ElementAnimations.h" |
| 26 #include "core/dom/Attr.h" | 26 #include "core/dom/Attr.h" |
| 27 #include "core/dom/CompositorProxiedPropertySet.h" | 27 #include "core/dom/CompositorProxiedPropertySet.h" |
| 28 #include "core/dom/DatasetDOMStringMap.h" | 28 #include "core/dom/DatasetDOMStringMap.h" |
| 29 #include "core/dom/ElementIntersectionObserverData.h" | |
| 29 #include "core/dom/NamedNodeMap.h" | 30 #include "core/dom/NamedNodeMap.h" |
| 30 #include "core/dom/NodeRareData.h" | 31 #include "core/dom/NodeRareData.h" |
| 31 #include "core/dom/PseudoElement.h" | 32 #include "core/dom/PseudoElement.h" |
| 32 #include "core/dom/custom/CustomElementDefinition.h" | 33 #include "core/dom/custom/CustomElementDefinition.h" |
| 33 #include "core/dom/shadow/ElementShadow.h" | 34 #include "core/dom/shadow/ElementShadow.h" |
| 34 #include "core/html/ClassList.h" | 35 #include "core/html/ClassList.h" |
| 35 #include "core/style/StyleInheritedData.h" | 36 #include "core/style/StyleInheritedData.h" |
| 36 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 #include "wtf/HashSet.h" | |
| 37 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
| 38 | 40 |
| 39 namespace blink { | 41 namespace blink { |
| 40 | 42 |
| 41 class HTMLElement; | 43 class HTMLElement; |
| 42 class CompositorProxiedPropertySet; | 44 class CompositorProxiedPropertySet; |
| 43 | 45 |
| 44 class ElementRareData : public NodeRareData { | 46 class ElementRareData : public NodeRareData { |
| 45 public: | 47 public: |
| 46 static ElementRareData* create(LayoutObject* layoutObject) | 48 static ElementRareData* create(LayoutObject* layoutObject) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 void decrementCompositorProxiedProperties(uint32_t properties); | 118 void decrementCompositorProxiedProperties(uint32_t properties); |
| 117 CompositorProxiedPropertySet* proxiedPropertyCounts() const { return m_proxi edProperties.get(); } | 119 CompositorProxiedPropertySet* proxiedPropertyCounts() const { return m_proxi edProperties.get(); } |
| 118 | 120 |
| 119 void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefiniti on> definition) { m_customElementDefinition = definition; } | 121 void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefiniti on> definition) { m_customElementDefinition = definition; } |
| 120 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); } | 122 CustomElementDefinition* customElementDefinition() const { return m_customEl ementDefinition.get(); } |
| 121 | 123 |
| 122 AttrNodeList& ensureAttrNodeList(); | 124 AttrNodeList& ensureAttrNodeList(); |
| 123 AttrNodeList* attrNodeList() { return m_attrNodeList.get(); } | 125 AttrNodeList* attrNodeList() { return m_attrNodeList.get(); } |
| 124 void removeAttrNodeList() { m_attrNodeList.clear(); } | 126 void removeAttrNodeList() { m_attrNodeList.clear(); } |
| 125 | 127 |
| 128 bool hasIntersectionObserverData() const { return m_intersectionObserverData ; } | |
|
esprehn
2015/12/22 07:50:32
Have a * foo() and a & ensureFoo() methods. no has
| |
| 129 ElementIntersectionObserverData& ensureIntersectionObserverData() | |
| 130 { | |
| 131 if (!m_intersectionObserverData) | |
| 132 m_intersectionObserverData = new ElementIntersectionObserverData(); | |
| 133 return *m_intersectionObserverData; | |
| 134 } | |
| 135 | |
| 126 DECLARE_TRACE_AFTER_DISPATCH(); | 136 DECLARE_TRACE_AFTER_DISPATCH(); |
| 127 | 137 |
| 128 private: | 138 private: |
| 129 CompositorProxiedPropertySet& ensureCompositorProxiedPropertySet(); | 139 CompositorProxiedPropertySet& ensureCompositorProxiedPropertySet(); |
| 130 void clearCompositorProxiedPropertySet() { m_proxiedProperties = nullptr; } | 140 void clearCompositorProxiedPropertySet() { m_proxiedProperties = nullptr; } |
| 131 | 141 |
| 132 short m_tabindex; | 142 short m_tabindex; |
| 133 | 143 |
| 134 LayoutSize m_minimumSizeForResizing; | 144 LayoutSize m_minimumSizeForResizing; |
| 135 IntSize m_savedLayerScrollOffset; | 145 IntSize m_savedLayerScrollOffset; |
| 136 | 146 |
| 137 OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset; | 147 OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset; |
| 138 OwnPtrWillBeMember<ClassList> m_classList; | 148 OwnPtrWillBeMember<ClassList> m_classList; |
| 139 OwnPtrWillBeMember<ElementShadow> m_shadow; | 149 OwnPtrWillBeMember<ElementShadow> m_shadow; |
| 140 OwnPtrWillBeMember<NamedNodeMap> m_attributeMap; | 150 OwnPtrWillBeMember<NamedNodeMap> m_attributeMap; |
| 141 OwnPtrWillBeMember<AttrNodeList> m_attrNodeList; | 151 OwnPtrWillBeMember<AttrNodeList> m_attrNodeList; |
| 142 PersistentWillBeMember<ElementAnimations> m_elementAnimations; | |
| 143 OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper; | 152 OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper; |
| 144 OwnPtr<CompositorProxiedPropertySet> m_proxiedProperties; | 153 OwnPtr<CompositorProxiedPropertySet> m_proxiedProperties; |
| 145 | 154 |
| 155 PersistentWillBeMember<ElementAnimations> m_elementAnimations; | |
| 156 PersistentWillBeMember<ElementIntersectionObserverData> m_intersectionObserv erData; | |
| 157 | |
| 146 RefPtr<ComputedStyle> m_computedStyle; | 158 RefPtr<ComputedStyle> m_computedStyle; |
| 147 RefPtrWillBeMember<CustomElementDefinition> m_customElementDefinition; | 159 RefPtrWillBeMember<CustomElementDefinition> m_customElementDefinition; |
| 148 | 160 |
| 149 RefPtrWillBeMember<PseudoElement> m_generatedBefore; | 161 RefPtrWillBeMember<PseudoElement> m_generatedBefore; |
| 150 RefPtrWillBeMember<PseudoElement> m_generatedAfter; | 162 RefPtrWillBeMember<PseudoElement> m_generatedAfter; |
| 151 RefPtrWillBeMember<PseudoElement> m_generatedFirstLetter; | 163 RefPtrWillBeMember<PseudoElement> m_generatedFirstLetter; |
| 152 RefPtrWillBeMember<PseudoElement> m_backdrop; | 164 RefPtrWillBeMember<PseudoElement> m_backdrop; |
| 153 | 165 |
| 154 explicit ElementRareData(LayoutObject*); | 166 explicit ElementRareData(LayoutObject*); |
| 155 }; | 167 }; |
| 156 | 168 |
| 157 inline LayoutSize defaultMinimumSizeForResizing() | 169 inline LayoutSize defaultMinimumSizeForResizing() |
| 158 { | 170 { |
| 159 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); | 171 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); |
| 160 } | 172 } |
| 161 | 173 |
| 162 inline ElementRareData::ElementRareData(LayoutObject* layoutObject) | 174 inline ElementRareData::ElementRareData(LayoutObject* layoutObject) |
| 163 : NodeRareData(layoutObject) | 175 : NodeRareData(layoutObject) |
| 164 , m_tabindex(0) | 176 , m_tabindex(0) |
| 165 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) | 177 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) |
| 166 { | 178 { |
| 167 m_isElementRareData = true; | 179 m_isElementRareData = true; |
| 168 } | 180 } |
| 169 | 181 |
| 170 inline ElementRareData::~ElementRareData() | 182 inline ElementRareData::~ElementRareData() |
| 171 { | 183 { |
| 172 #if !ENABLE(OILPAN) | 184 #if !ENABLE(OILPAN) |
| 173 if (m_elementAnimations) | 185 if (m_elementAnimations) |
| 174 m_elementAnimations->dispose(); | 186 m_elementAnimations->dispose(); |
| 187 if (m_intersectionObserverData) | |
| 188 m_intersectionObserverData->dispose(); | |
| 175 ASSERT(!m_shadow); | 189 ASSERT(!m_shadow); |
| 176 #endif | 190 #endif |
| 177 ASSERT(!m_generatedBefore); | 191 ASSERT(!m_generatedBefore); |
| 178 ASSERT(!m_generatedAfter); | 192 ASSERT(!m_generatedAfter); |
| 179 ASSERT(!m_generatedFirstLetter); | 193 ASSERT(!m_generatedFirstLetter); |
| 180 ASSERT(!m_backdrop); | 194 ASSERT(!m_backdrop); |
| 181 } | 195 } |
| 182 | 196 |
| 183 inline bool ElementRareData::hasPseudoElements() const | 197 inline bool ElementRareData::hasPseudoElements() const |
| 184 { | 198 { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro pertySet() | 266 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro pertySet() |
| 253 { | 267 { |
| 254 if (!m_proxiedProperties) | 268 if (!m_proxiedProperties) |
| 255 m_proxiedProperties = CompositorProxiedPropertySet::create(); | 269 m_proxiedProperties = CompositorProxiedPropertySet::create(); |
| 256 return *m_proxiedProperties; | 270 return *m_proxiedProperties; |
| 257 } | 271 } |
| 258 | 272 |
| 259 } // namespace | 273 } // namespace |
| 260 | 274 |
| 261 #endif // ElementRareData_h | 275 #endif // ElementRareData_h |
| OLD | NEW |