Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / svg / SVGElementRareData.h
blob974ce2790c5c8ad485a96c1d5f40a4d1d316943f
1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
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
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef SVGElementRareData_h
21 #define SVGElementRareData_h
23 #include "core/svg/SVGElement.h"
24 #include "platform/heap/Handle.h"
25 #include "wtf/HashSet.h"
26 #include "wtf/Noncopyable.h"
27 #include "wtf/StdLibExtras.h"
29 namespace blink {
31 class CSSCursorImageValue;
32 class SVGCursorElement;
34 class SVGElementRareData : public NoBaseWillBeGarbageCollectedFinalized<SVGElementRareData> {
35 WTF_MAKE_NONCOPYABLE(SVGElementRareData); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(SVGElementRareData);
36 public:
37 SVGElementRareData(SVGElement* owner)
38 #if ENABLE(OILPAN)
39 : m_owner(owner)
40 , m_cursorElement(nullptr)
41 #else
42 : m_cursorElement(nullptr)
43 #endif
44 , m_cursorImageValue(nullptr)
45 , m_correspondingElement(nullptr)
46 , m_instancesUpdatesBlocked(false)
47 , m_useOverrideComputedStyle(false)
48 , m_needsOverrideComputedStyleUpdate(false)
52 SVGElementSet& outgoingReferences() { return m_outgoingReferences; }
53 const SVGElementSet& outgoingReferences() const { return m_outgoingReferences; }
54 SVGElementSet& incomingReferences() { return m_incomingReferences; }
55 const SVGElementSet& incomingReferences() const { return m_incomingReferences; }
57 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& elementInstances() { return m_elementInstances; }
58 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& elementInstances() const { return m_elementInstances; }
60 bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; }
61 void setInstanceUpdatesBlocked(bool value) { m_instancesUpdatesBlocked = value; }
63 SVGCursorElement* cursorElement() const { return m_cursorElement; }
64 void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; }
66 SVGElement* correspondingElement() { return m_correspondingElement.get(); }
67 void setCorrespondingElement(SVGElement* correspondingElement) { m_correspondingElement = correspondingElement; }
69 CSSCursorImageValue* cursorImageValue() const { return m_cursorImageValue; }
70 void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; }
72 MutableStylePropertySet* animatedSMILStyleProperties() const { return m_animatedSMILStyleProperties.get(); }
73 MutableStylePropertySet* ensureAnimatedSMILStyleProperties();
75 ComputedStyle* overrideComputedStyle(Element*, const ComputedStyle*);
77 bool useOverrideComputedStyle() const { return m_useOverrideComputedStyle; }
78 void setUseOverrideComputedStyle(bool value) { m_useOverrideComputedStyle = value; }
79 void setNeedsOverrideComputedStyleUpdate() { m_needsOverrideComputedStyleUpdate = true; }
81 AffineTransform* animateMotionTransform();
83 DECLARE_TRACE();
84 void processWeakMembers(Visitor*);
86 private:
87 #if ENABLE(OILPAN)
88 Member<SVGElement> m_owner;
89 #endif
90 SVGElementSet m_outgoingReferences;
91 SVGElementSet m_incomingReferences;
92 WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>> m_elementInstances;
93 RawPtrWillBeWeakMember<SVGCursorElement> m_cursorElement;
94 RawPtrWillBeWeakMember<CSSCursorImageValue> m_cursorImageValue;
95 RefPtrWillBeMember<SVGElement> m_correspondingElement;
96 bool m_instancesUpdatesBlocked : 1;
97 bool m_useOverrideComputedStyle : 1;
98 bool m_needsOverrideComputedStyleUpdate : 1;
99 RefPtrWillBeMember<MutableStylePropertySet> m_animatedSMILStyleProperties;
100 RefPtr<ComputedStyle> m_overrideComputedStyle;
101 // Used by <animateMotion>
102 OwnPtr<AffineTransform> m_animateMotionTransform;
107 #endif