| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef SVGElementRareData_h | 20 #ifndef SVGElementRareData_h |
| 21 #define SVGElementRareData_h | 21 #define SVGElementRareData_h |
| 22 | 22 |
| 23 #include "core/style/ComputedStyle.h" | 23 #include "core/style/ComputedStyle.h" |
| 24 #include "core/svg/SVGElement.h" | 24 #include "core/svg/SVGElement.h" |
| 25 #include "platform/heap/Handle.h" | 25 #include "platform/heap/Handle.h" |
| 26 #include "platform/transforms/AffineTransform.h" | 26 #include "platform/transforms/AffineTransform.h" |
| 27 #include "wtf/HashSet.h" | 27 #include "wtf/HashSet.h" |
| 28 #include "wtf/Noncopyable.h" | 28 #include "wtf/Noncopyable.h" |
| 29 #include "wtf/StdLibExtras.h" | |
| 30 | 29 |
| 31 namespace blink { | 30 namespace blink { |
| 32 | 31 |
| 33 class CSSCursorImageValue; | |
| 34 class SVGCursorElement; | |
| 35 class SVGElementProxySet; | 32 class SVGElementProxySet; |
| 36 | 33 |
| 37 class SVGElementRareData | 34 class SVGElementRareData |
| 38 : public GarbageCollectedFinalized<SVGElementRareData> { | 35 : public GarbageCollectedFinalized<SVGElementRareData> { |
| 39 WTF_MAKE_NONCOPYABLE(SVGElementRareData); | 36 WTF_MAKE_NONCOPYABLE(SVGElementRareData); |
| 40 | 37 |
| 41 public: | 38 public: |
| 42 SVGElementRareData(SVGElement* owner) | 39 SVGElementRareData(SVGElement* owner) |
| 43 : m_owner(owner), | 40 : m_owner(owner), |
| 44 m_cursorElement(nullptr), | |
| 45 m_cursorImageValue(nullptr), | |
| 46 m_correspondingElement(nullptr), | 41 m_correspondingElement(nullptr), |
| 47 m_instancesUpdatesBlocked(false), | 42 m_instancesUpdatesBlocked(false), |
| 48 m_useOverrideComputedStyle(false), | 43 m_useOverrideComputedStyle(false), |
| 49 m_needsOverrideComputedStyleUpdate(false), | 44 m_needsOverrideComputedStyleUpdate(false), |
| 50 m_webAnimatedAttributesDirty(false) {} | 45 m_webAnimatedAttributesDirty(false) {} |
| 51 | 46 |
| 52 SVGElementSet& outgoingReferences() { return m_outgoingReferences; } | 47 SVGElementSet& outgoingReferences() { return m_outgoingReferences; } |
| 53 const SVGElementSet& outgoingReferences() const { | 48 const SVGElementSet& outgoingReferences() const { |
| 54 return m_outgoingReferences; | 49 return m_outgoingReferences; |
| 55 } | 50 } |
| 56 SVGElementSet& incomingReferences() { return m_incomingReferences; } | 51 SVGElementSet& incomingReferences() { return m_incomingReferences; } |
| 57 const SVGElementSet& incomingReferences() const { | 52 const SVGElementSet& incomingReferences() const { |
| 58 return m_incomingReferences; | 53 return m_incomingReferences; |
| 59 } | 54 } |
| 60 | 55 |
| 61 SVGElementProxySet& ensureElementProxySet(); | 56 SVGElementProxySet& ensureElementProxySet(); |
| 62 | 57 |
| 63 HeapHashSet<WeakMember<SVGElement>>& elementInstances() { | 58 HeapHashSet<WeakMember<SVGElement>>& elementInstances() { |
| 64 return m_elementInstances; | 59 return m_elementInstances; |
| 65 } | 60 } |
| 66 const HeapHashSet<WeakMember<SVGElement>>& elementInstances() const { | 61 const HeapHashSet<WeakMember<SVGElement>>& elementInstances() const { |
| 67 return m_elementInstances; | 62 return m_elementInstances; |
| 68 } | 63 } |
| 69 | 64 |
| 70 bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; } | 65 bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; } |
| 71 void setInstanceUpdatesBlocked(bool value) { | 66 void setInstanceUpdatesBlocked(bool value) { |
| 72 m_instancesUpdatesBlocked = value; | 67 m_instancesUpdatesBlocked = value; |
| 73 } | 68 } |
| 74 | 69 |
| 75 SVGCursorElement* cursorElement() const { return m_cursorElement; } | |
| 76 void setCursorElement(SVGCursorElement* cursorElement) { | |
| 77 m_cursorElement = cursorElement; | |
| 78 } | |
| 79 | |
| 80 SVGElement* correspondingElement() const { | 70 SVGElement* correspondingElement() const { |
| 81 return m_correspondingElement.get(); | 71 return m_correspondingElement.get(); |
| 82 } | 72 } |
| 83 void setCorrespondingElement(SVGElement* correspondingElement) { | 73 void setCorrespondingElement(SVGElement* correspondingElement) { |
| 84 m_correspondingElement = correspondingElement; | 74 m_correspondingElement = correspondingElement; |
| 85 } | 75 } |
| 86 | 76 |
| 87 const CSSCursorImageValue* cursorImageValue() const { | |
| 88 return m_cursorImageValue; | |
| 89 } | |
| 90 void setCursorImageValue(const CSSCursorImageValue* cursorImageValue) { | |
| 91 m_cursorImageValue = cursorImageValue; | |
| 92 } | |
| 93 | |
| 94 void setWebAnimatedAttributesDirty(bool dirty) { | 77 void setWebAnimatedAttributesDirty(bool dirty) { |
| 95 m_webAnimatedAttributesDirty = dirty; | 78 m_webAnimatedAttributesDirty = dirty; |
| 96 } | 79 } |
| 97 bool webAnimatedAttributesDirty() const { | 80 bool webAnimatedAttributesDirty() const { |
| 98 return m_webAnimatedAttributesDirty; | 81 return m_webAnimatedAttributesDirty; |
| 99 } | 82 } |
| 100 | 83 |
| 101 HashSet<const QualifiedName*>& webAnimatedAttributes() { | 84 HashSet<const QualifiedName*>& webAnimatedAttributes() { |
| 102 return m_webAnimatedAttributes; | 85 return m_webAnimatedAttributes; |
| 103 } | 86 } |
| 104 | 87 |
| 105 MutableStylePropertySet* animatedSMILStyleProperties() const { | 88 MutableStylePropertySet* animatedSMILStyleProperties() const { |
| 106 return m_animatedSMILStyleProperties.get(); | 89 return m_animatedSMILStyleProperties.get(); |
| 107 } | 90 } |
| 108 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); | 91 MutableStylePropertySet* ensureAnimatedSMILStyleProperties(); |
| 109 | 92 |
| 110 ComputedStyle* overrideComputedStyle(Element*, const ComputedStyle*); | 93 ComputedStyle* overrideComputedStyle(Element*, const ComputedStyle*); |
| 111 | 94 |
| 112 bool useOverrideComputedStyle() const { return m_useOverrideComputedStyle; } | 95 bool useOverrideComputedStyle() const { return m_useOverrideComputedStyle; } |
| 113 void setUseOverrideComputedStyle(bool value) { | 96 void setUseOverrideComputedStyle(bool value) { |
| 114 m_useOverrideComputedStyle = value; | 97 m_useOverrideComputedStyle = value; |
| 115 } | 98 } |
| 116 void setNeedsOverrideComputedStyleUpdate() { | 99 void setNeedsOverrideComputedStyleUpdate() { |
| 117 m_needsOverrideComputedStyleUpdate = true; | 100 m_needsOverrideComputedStyleUpdate = true; |
| 118 } | 101 } |
| 119 | 102 |
| 120 AffineTransform* animateMotionTransform(); | 103 AffineTransform* animateMotionTransform(); |
| 121 | 104 |
| 122 DECLARE_TRACE(); | 105 DECLARE_TRACE(); |
| 123 void processWeakMembers(Visitor*); | |
| 124 | 106 |
| 125 private: | 107 private: |
| 126 Member<SVGElement> m_owner; | 108 Member<SVGElement> m_owner; |
| 127 SVGElementSet m_outgoingReferences; | 109 SVGElementSet m_outgoingReferences; |
| 128 SVGElementSet m_incomingReferences; | 110 SVGElementSet m_incomingReferences; |
| 129 HeapHashSet<WeakMember<SVGElement>> m_elementInstances; | 111 HeapHashSet<WeakMember<SVGElement>> m_elementInstances; |
| 130 WeakMember<SVGCursorElement> m_cursorElement; | |
| 131 WeakMember<const CSSCursorImageValue> m_cursorImageValue; | |
| 132 Member<SVGElementProxySet> m_elementProxySet; | 112 Member<SVGElementProxySet> m_elementProxySet; |
| 133 Member<SVGElement> m_correspondingElement; | 113 Member<SVGElement> m_correspondingElement; |
| 134 bool m_instancesUpdatesBlocked : 1; | 114 bool m_instancesUpdatesBlocked : 1; |
| 135 bool m_useOverrideComputedStyle : 1; | 115 bool m_useOverrideComputedStyle : 1; |
| 136 bool m_needsOverrideComputedStyleUpdate : 1; | 116 bool m_needsOverrideComputedStyleUpdate : 1; |
| 137 bool m_webAnimatedAttributesDirty : 1; | 117 bool m_webAnimatedAttributesDirty : 1; |
| 138 HashSet<const QualifiedName*> m_webAnimatedAttributes; | 118 HashSet<const QualifiedName*> m_webAnimatedAttributes; |
| 139 Member<MutableStylePropertySet> m_animatedSMILStyleProperties; | 119 Member<MutableStylePropertySet> m_animatedSMILStyleProperties; |
| 140 RefPtr<ComputedStyle> m_overrideComputedStyle; | 120 RefPtr<ComputedStyle> m_overrideComputedStyle; |
| 141 // Used by <animateMotion> | 121 // Used by <animateMotion> |
| 142 AffineTransform m_animateMotionTransform; | 122 AffineTransform m_animateMotionTransform; |
| 143 }; | 123 }; |
| 144 | 124 |
| 145 } // namespace blink | 125 } // namespace blink |
| 146 | 126 |
| 147 #endif | 127 #endif |
| OLD | NEW |