| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 class ElementRareData : public NodeRareData { | 46 class ElementRareData : public NodeRareData { |
| 47 public: | 47 public: |
| 48 static ElementRareData* create(LayoutObject* layoutObject) | 48 static ElementRareData* create(LayoutObject* layoutObject) |
| 49 { | 49 { |
| 50 return new ElementRareData(layoutObject); | 50 return new ElementRareData(layoutObject); |
| 51 } | 51 } |
| 52 | 52 |
| 53 ~ElementRareData(); | 53 ~ElementRareData(); |
| 54 | 54 |
| 55 void setPseudoElement(PseudoId, PassRefPtrWillBeRawPtr<PseudoElement>); | 55 void setPseudoElement(PseudoId, RawPtr<PseudoElement>); |
| 56 PseudoElement* pseudoElement(PseudoId) const; | 56 PseudoElement* pseudoElement(PseudoId) const; |
| 57 | 57 |
| 58 short tabIndex() const { return m_tabindex; } | 58 short tabIndex() const { return m_tabindex; } |
| 59 | 59 |
| 60 void setTabIndexExplicitly(short index) | 60 void setTabIndexExplicitly(short index) |
| 61 { | 61 { |
| 62 m_tabindex = index; | 62 m_tabindex = index; |
| 63 setElementFlag(TabIndexWasSetExplicitly, true); | 63 setElementFlag(TabIndexWasSetExplicitly, true); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void clearTabIndexExplicitly() | 66 void clearTabIndexExplicitly() |
| 67 { | 67 { |
| 68 m_tabindex = 0; | 68 m_tabindex = 0; |
| 69 clearElementFlag(TabIndexWasSetExplicitly); | 69 clearElementFlag(TabIndexWasSetExplicitly); |
| 70 } | 70 } |
| 71 | 71 |
| 72 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); | 72 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); |
| 73 | 73 |
| 74 void clearShadow() { m_shadow = nullptr; } | 74 void clearShadow() { m_shadow = nullptr; } |
| 75 ElementShadow* shadow() const { return m_shadow.get(); } | 75 ElementShadow* shadow() const { return m_shadow.get(); } |
| 76 ElementShadow& ensureShadow() | 76 ElementShadow& ensureShadow() |
| 77 { | 77 { |
| 78 if (!m_shadow) | 78 if (!m_shadow) |
| 79 m_shadow = ElementShadow::create(); | 79 m_shadow = ElementShadow::create(); |
| 80 return *m_shadow; | 80 return *m_shadow; |
| 81 } | 81 } |
| 82 | 82 |
| 83 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); } | 83 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); } |
| 84 void setAttributeMap(PassOwnPtrWillBeRawPtr<NamedNodeMap> attributeMap) { m_
attributeMap = attributeMap; } | 84 void setAttributeMap(RawPtr<NamedNodeMap> attributeMap) { m_attributeMap = a
ttributeMap; } |
| 85 | 85 |
| 86 ComputedStyle* ensureComputedStyle() const { return m_computedStyle.get(); } | 86 ComputedStyle* ensureComputedStyle() const { return m_computedStyle.get(); } |
| 87 void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle) { m_computedS
tyle = computedStyle; } | 87 void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle) { m_computedS
tyle = computedStyle; } |
| 88 void clearComputedStyle() { m_computedStyle = nullptr; } | 88 void clearComputedStyle() { m_computedStyle = nullptr; } |
| 89 | 89 |
| 90 ClassList* classList() const { return m_classList.get(); } | 90 ClassList* classList() const { return m_classList.get(); } |
| 91 void setClassList(PassOwnPtrWillBeRawPtr<ClassList> classList) { m_classList
= classList; } | 91 void setClassList(RawPtr<ClassList> classList) { m_classList = classList; } |
| 92 void clearClassListValueForQuirksMode() | 92 void clearClassListValueForQuirksMode() |
| 93 { | 93 { |
| 94 if (!m_classList) | 94 if (!m_classList) |
| 95 return; | 95 return; |
| 96 m_classList->clearValueForQuirksMode(); | 96 m_classList->clearValueForQuirksMode(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 DatasetDOMStringMap* dataset() const { return m_dataset.get(); } | 99 DatasetDOMStringMap* dataset() const { return m_dataset.get(); } |
| 100 void setDataset(PassOwnPtrWillBeRawPtr<DatasetDOMStringMap> dataset) { m_dat
aset = dataset; } | 100 void setDataset(RawPtr<DatasetDOMStringMap> dataset) { m_dataset = dataset;
} |
| 101 | 101 |
| 102 LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing;
} | 102 LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing;
} |
| 103 void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing =
size; } | 103 void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing =
size; } |
| 104 | 104 |
| 105 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } | 105 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } |
| 106 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } | 106 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } |
| 107 | 107 |
| 108 ElementAnimations* elementAnimations() { return m_elementAnimations.get(); } | 108 ElementAnimations* elementAnimations() { return m_elementAnimations.get(); } |
| 109 void setElementAnimations(ElementAnimations* elementAnimations) | 109 void setElementAnimations(ElementAnimations* elementAnimations) |
| 110 { | 110 { |
| 111 m_elementAnimations = elementAnimations; | 111 m_elementAnimations = elementAnimations; |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool hasPseudoElements() const; | 114 bool hasPseudoElements() const; |
| 115 void clearPseudoElements(); | 115 void clearPseudoElements(); |
| 116 | 116 |
| 117 void incrementCompositorProxiedProperties(uint32_t properties); | 117 void incrementCompositorProxiedProperties(uint32_t properties); |
| 118 void decrementCompositorProxiedProperties(uint32_t properties); | 118 void decrementCompositorProxiedProperties(uint32_t properties); |
| 119 CompositorProxiedPropertySet* proxiedPropertyCounts() const { return m_proxi
edProperties.get(); } | 119 CompositorProxiedPropertySet* proxiedPropertyCounts() const { return m_proxi
edProperties.get(); } |
| 120 | 120 |
| 121 void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefiniti
on> definition) { m_customElementDefinition = definition; } | 121 void setCustomElementDefinition(RawPtr<CustomElementDefinition> definition)
{ m_customElementDefinition = definition; } |
| 122 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 122 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
| 123 | 123 |
| 124 AttrNodeList& ensureAttrNodeList(); | 124 AttrNodeList& ensureAttrNodeList(); |
| 125 AttrNodeList* attrNodeList() { return m_attrNodeList.get(); } | 125 AttrNodeList* attrNodeList() { return m_attrNodeList.get(); } |
| 126 void removeAttrNodeList() { m_attrNodeList.clear(); } | 126 void removeAttrNodeList() { m_attrNodeList.clear(); } |
| 127 | 127 |
| 128 NodeIntersectionObserverData* intersectionObserverData() const { return m_in
tersectionObserverData.get(); } | 128 NodeIntersectionObserverData* intersectionObserverData() const { return m_in
tersectionObserverData.get(); } |
| 129 NodeIntersectionObserverData& ensureIntersectionObserverData() | 129 NodeIntersectionObserverData& ensureIntersectionObserverData() |
| 130 { | 130 { |
| 131 if (!m_intersectionObserverData) | 131 if (!m_intersectionObserverData) |
| 132 m_intersectionObserverData = new NodeIntersectionObserverData(); | 132 m_intersectionObserverData = new NodeIntersectionObserverData(); |
| 133 return *m_intersectionObserverData; | 133 return *m_intersectionObserverData; |
| 134 } | 134 } |
| 135 | 135 |
| 136 DECLARE_TRACE_AFTER_DISPATCH(); | 136 DECLARE_TRACE_AFTER_DISPATCH(); |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 CompositorProxiedPropertySet& ensureCompositorProxiedPropertySet(); | 139 CompositorProxiedPropertySet& ensureCompositorProxiedPropertySet(); |
| 140 void clearCompositorProxiedPropertySet() { m_proxiedProperties = nullptr; } | 140 void clearCompositorProxiedPropertySet() { m_proxiedProperties = nullptr; } |
| 141 | 141 |
| 142 short m_tabindex; | 142 short m_tabindex; |
| 143 | 143 |
| 144 LayoutSize m_minimumSizeForResizing; | 144 LayoutSize m_minimumSizeForResizing; |
| 145 IntSize m_savedLayerScrollOffset; | 145 IntSize m_savedLayerScrollOffset; |
| 146 | 146 |
| 147 OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset; | 147 Member<DatasetDOMStringMap> m_dataset; |
| 148 OwnPtrWillBeMember<ClassList> m_classList; | 148 Member<ClassList> m_classList; |
| 149 OwnPtrWillBeMember<ElementShadow> m_shadow; | 149 Member<ElementShadow> m_shadow; |
| 150 OwnPtrWillBeMember<NamedNodeMap> m_attributeMap; | 150 Member<NamedNodeMap> m_attributeMap; |
| 151 OwnPtrWillBeMember<AttrNodeList> m_attrNodeList; | 151 Member<AttrNodeList> m_attrNodeList; |
| 152 OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper; | 152 Member<InlineCSSStyleDeclaration> m_cssomWrapper; |
| 153 OwnPtr<CompositorProxiedPropertySet> m_proxiedProperties; | 153 OwnPtr<CompositorProxiedPropertySet> m_proxiedProperties; |
| 154 | 154 |
| 155 PersistentWillBeMember<ElementAnimations> m_elementAnimations; | 155 Member<ElementAnimations> m_elementAnimations; |
| 156 PersistentWillBeMember<NodeIntersectionObserverData> m_intersectionObserverD
ata; | 156 Member<NodeIntersectionObserverData> m_intersectionObserverData; |
| 157 | 157 |
| 158 RefPtr<ComputedStyle> m_computedStyle; | 158 RefPtr<ComputedStyle> m_computedStyle; |
| 159 RefPtrWillBeMember<CustomElementDefinition> m_customElementDefinition; | 159 Member<CustomElementDefinition> m_customElementDefinition; |
| 160 | 160 |
| 161 RefPtrWillBeMember<PseudoElement> m_generatedBefore; | 161 Member<PseudoElement> m_generatedBefore; |
| 162 RefPtrWillBeMember<PseudoElement> m_generatedAfter; | 162 Member<PseudoElement> m_generatedAfter; |
| 163 RefPtrWillBeMember<PseudoElement> m_generatedFirstLetter; | 163 Member<PseudoElement> m_generatedFirstLetter; |
| 164 RefPtrWillBeMember<PseudoElement> m_backdrop; | 164 Member<PseudoElement> m_backdrop; |
| 165 | 165 |
| 166 explicit ElementRareData(LayoutObject*); | 166 explicit ElementRareData(LayoutObject*); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 inline LayoutSize defaultMinimumSizeForResizing() | 169 inline LayoutSize defaultMinimumSizeForResizing() |
| 170 { | 170 { |
| 171 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); | 171 return LayoutSize(LayoutUnit::max(), LayoutUnit::max()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 inline ElementRareData::ElementRareData(LayoutObject* layoutObject) | 174 inline ElementRareData::ElementRareData(LayoutObject* layoutObject) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 inline void ElementRareData::clearPseudoElements() | 202 inline void ElementRareData::clearPseudoElements() |
| 203 { | 203 { |
| 204 setPseudoElement(BEFORE, nullptr); | 204 setPseudoElement(BEFORE, nullptr); |
| 205 setPseudoElement(AFTER, nullptr); | 205 setPseudoElement(AFTER, nullptr); |
| 206 setPseudoElement(BACKDROP, nullptr); | 206 setPseudoElement(BACKDROP, nullptr); |
| 207 setPseudoElement(FIRST_LETTER, nullptr); | 207 setPseudoElement(FIRST_LETTER, nullptr); |
| 208 } | 208 } |
| 209 | 209 |
| 210 inline void ElementRareData::setPseudoElement(PseudoId pseudoId, PassRefPtrWillB
eRawPtr<PseudoElement> element) | 210 inline void ElementRareData::setPseudoElement(PseudoId pseudoId, RawPtr<PseudoEl
ement> element) |
| 211 { | 211 { |
| 212 switch (pseudoId) { | 212 switch (pseudoId) { |
| 213 case BEFORE: | 213 case BEFORE: |
| 214 if (m_generatedBefore) | 214 if (m_generatedBefore) |
| 215 m_generatedBefore->dispose(); | 215 m_generatedBefore->dispose(); |
| 216 m_generatedBefore = element; | 216 m_generatedBefore = element; |
| 217 break; | 217 break; |
| 218 case AFTER: | 218 case AFTER: |
| 219 if (m_generatedAfter) | 219 if (m_generatedAfter) |
| 220 m_generatedAfter->dispose(); | 220 m_generatedAfter->dispose(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro
pertySet() | 266 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro
pertySet() |
| 267 { | 267 { |
| 268 if (!m_proxiedProperties) | 268 if (!m_proxiedProperties) |
| 269 m_proxiedProperties = CompositorProxiedPropertySet::create(); | 269 m_proxiedProperties = CompositorProxiedPropertySet::create(); |
| 270 return *m_proxiedProperties; | 270 return *m_proxiedProperties; |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace blink | 273 } // namespace blink |
| 274 | 274 |
| 275 #endif // ElementRareData_h | 275 #endif // ElementRareData_h |
| OLD | NEW |