diff options
Diffstat (limited to 'Source/WebCore/svg/SVGElementRareData.h')
-rw-r--r-- | Source/WebCore/svg/SVGElementRareData.h | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/Source/WebCore/svg/SVGElementRareData.h b/Source/WebCore/svg/SVGElementRareData.h index 981481b97..60dc538d5 100644 --- a/Source/WebCore/svg/SVGElementRareData.h +++ b/Source/WebCore/svg/SVGElementRareData.h @@ -17,8 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#ifndef SVGElementRareData_h -#define SVGElementRareData_h +#pragma once #include "StyleProperties.h" #include "StyleResolver.h" @@ -31,36 +30,26 @@ namespace WebCore { class CSSCursorImageValue; class SVGCursorElement; class SVGElement; -class SVGElementInstance; class SVGElementRareData { WTF_MAKE_NONCOPYABLE(SVGElementRareData); WTF_MAKE_FAST_ALLOCATED; public: SVGElementRareData() - : m_cursorElement(0) - , m_cursorImageValue(0) - , m_correspondingElement(0) - , m_instancesUpdatesBlocked(false) + : m_instancesUpdatesBlocked(false) , m_useOverrideComputedStyle(false) , m_needsOverrideComputedStyleUpdate(false) { } - HashSet<SVGElementInstance*>& elementInstances() { return m_elementInstances; } - const HashSet<SVGElementInstance*>& elementInstances() const { return m_elementInstances; } + HashSet<SVGElement*>& instances() { return m_instances; } + const HashSet<SVGElement*>& instances() const { return m_instances; } bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; } void setInstanceUpdatesBlocked(bool value) { m_instancesUpdatesBlocked = value; } - SVGCursorElement* cursorElement() const { return m_cursorElement; } - void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; } - SVGElement* correspondingElement() { return m_correspondingElement; } void setCorrespondingElement(SVGElement* correspondingElement) { m_correspondingElement = correspondingElement; } - CSSCursorImageValue* cursorImageValue() const { return m_cursorImageValue; } - void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; } - MutableStyleProperties* animatedSMILStyleProperties() const { return m_animatedSMILStyleProperties.get(); } MutableStyleProperties& ensureAnimatedSMILStyleProperties() { @@ -69,19 +58,13 @@ public: return *m_animatedSMILStyleProperties; } - void destroyAnimatedSMILStyleProperties() - { - m_animatedSMILStyleProperties.clear(); - } - - RenderStyle* overrideComputedStyle(Element* element, RenderStyle* parentStyle) + const RenderStyle* overrideComputedStyle(Element& element, const RenderStyle* parentStyle) { - ASSERT(element); if (!m_useOverrideComputedStyle) - return 0; + return nullptr; if (!m_overrideComputedStyle || m_needsOverrideComputedStyleUpdate) { // The style computed here contains no CSS Animations/Transitions or SMIL induced rules - this is needed to compute the "base value" for the SMIL animation sandwhich model. - m_overrideComputedStyle = element->document().ensureStyleResolver().styleForElement(element, parentStyle, DisallowStyleSharing, MatchAllRulesExcludingSMIL); + m_overrideComputedStyle = element.styleResolver().styleForElement(element, parentStyle, nullptr, MatchAllRulesExcludingSMIL).renderStyle; m_needsOverrideComputedStyleUpdate = false; } ASSERT(m_overrideComputedStyle); @@ -93,17 +76,13 @@ public: void setNeedsOverrideComputedStyleUpdate() { m_needsOverrideComputedStyleUpdate = true; } private: - HashSet<SVGElementInstance*> m_elementInstances; - SVGCursorElement* m_cursorElement; - CSSCursorImageValue* m_cursorImageValue; - SVGElement* m_correspondingElement; + HashSet<SVGElement*> m_instances; + SVGElement* m_correspondingElement { nullptr }; bool m_instancesUpdatesBlocked : 1; bool m_useOverrideComputedStyle : 1; bool m_needsOverrideComputedStyleUpdate : 1; RefPtr<MutableStyleProperties> m_animatedSMILStyleProperties; - RefPtr<RenderStyle> m_overrideComputedStyle; + std::unique_ptr<RenderStyle> m_overrideComputedStyle; }; -} - -#endif +} // namespace WebCore |