Title: [250488] trunk
Revision
250488
Author
s...@apple.com
Date
2019-09-28 22:16:58 -0700 (Sat, 28 Sep 2019)

Log Message

Crash when removing the target element while animating its attributes
https://bugs.webkit.org/show_bug.cgi?id=202247

Reviewed by Darin Adler.

Source/WebCore:

If SMIL is animating a CSS attribute, there is a chance the animation is
ended while it is being started or progressed. For that reason, the member
SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
be protected in resetAnimatedType() and calculateAnimatedValue().

While SMILTimeContainer::updateAnimations() is calling progress() for the
scheduled animation elements, SMILTimeContainer::unschedule() might get
called if processing an animation causes events to be dispatched. For that
reason we need to copy the scheduled animations Vector before processing
them so we avoid changing the Vector while looping through its items.

Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
which was added in r129670 for debugging purposes. In some situations, 
the scheduled animations map could be modified out from under some of the
functions of SMILTimeContainer.

Test: svg/animations/animate-and-remove-target-element.html

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
* svg/SVGAnimateElementBase.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::createAnimator):
* svg/SVGElement.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::schedule):
(WebCore::SMILTimeContainer::unschedule):
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::sortByPriority):
(WebCore::SMILTimeContainer::processAnimations):
(WebCore::SMILTimeContainer::processScheduledAnimations):
(WebCore::SMILTimeContainer::updateAnimations):
(WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime const):
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAnimator.h:
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
* svg/properties/SVGAttributeAnimator.h:
* svg/properties/SVGMemberAccessor.h:
(WebCore::SVGMemberAccessor::createAnimator const):
* svg/properties/SVGPrimitivePropertyAnimator.h:
(WebCore::SVGPrimitivePropertyAnimator::create):
* svg/properties/SVGPropertyAnimatorFactory.h:
(WebCore::SVGPropertyAnimatorFactory::createAnimator):
* svg/properties/SVGPropertyOwnerRegistry.h:
* svg/properties/SVGPropertyRegistry.h:
* svg/properties/SVGValuePropertyAnimatorImpl.h:
* svg/properties/SVGValuePropertyListAnimatorImpl.h:

LayoutTests:

* svg/animations/animate-and-remove-target-element-expected.txt: Added.
* svg/animations/animate-and-remove-target-element.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250487 => 250488)


--- trunk/LayoutTests/ChangeLog	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/LayoutTests/ChangeLog	2019-09-29 05:16:58 UTC (rev 250488)
@@ -1,3 +1,13 @@
+2019-09-28  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        Crash when removing the target element while animating its attributes
+        https://bugs.webkit.org/show_bug.cgi?id=202247
+
+        Reviewed by Darin Adler.
+
+        * svg/animations/animate-and-remove-target-element-expected.txt: Added.
+        * svg/animations/animate-and-remove-target-element.html: Added.
+
 2019-09-27  Chris Dumez  <cdu...@apple.com>
 
         Pages using WebGLRenderingContext fail to enter the back/forward cache

Added: trunk/LayoutTests/svg/animations/animate-and-remove-target-element-expected.txt (0 => 250488)


--- trunk/LayoutTests/svg/animations/animate-and-remove-target-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-and-remove-target-element-expected.txt	2019-09-29 05:16:58 UTC (rev 250488)
@@ -0,0 +1,4 @@
+Passes if it does not crash.
+
+ 
+

Added: trunk/LayoutTests/svg/animations/animate-and-remove-target-element.html (0 => 250488)


--- trunk/LayoutTests/svg/animations/animate-and-remove-target-element.html	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-and-remove-target-element.html	2019-09-29 05:16:58 UTC (rev 250488)
@@ -0,0 +1,33 @@
+<body>
+    <p>Passes if it does not crash.</p>
+    <form>
+        <select id="select" _onfocus_="onFocus()" multiple></select>
+        <keygen/>
+    </form>
+    <svg id="svg">
+        <animate attributeName="opacity" _onbegin_="onBegin()"/>
+    </svg>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        window.addEventListener('load', (event) => {
+            select.autofocus = true;
+        });
+
+        function onFocus(){
+            svg.remove();
+        }
+
+        function onBegin(){
+            select.removeAttribute("multiple");
+            svg.setCurrentTime(9);
+            setTimeout(() => {
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            });
+        }
+    </script>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (250487 => 250488)


--- trunk/Source/WebCore/ChangeLog	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/ChangeLog	2019-09-29 05:16:58 UTC (rev 250488)
@@ -1,3 +1,64 @@
+2019-09-28  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        Crash when removing the target element while animating its attributes
+        https://bugs.webkit.org/show_bug.cgi?id=202247
+
+        Reviewed by Darin Adler.
+
+        If SMIL is animating a CSS attribute, there is a chance the animation is
+        ended while it is being started or progressed. For that reason, the member
+        SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
+        be protected in resetAnimatedType() and calculateAnimatedValue().
+
+        While SMILTimeContainer::updateAnimations() is calling progress() for the
+        scheduled animation elements, SMILTimeContainer::unschedule() might get
+        called if processing an animation causes events to be dispatched. For that
+        reason we need to copy the scheduled animations Vector before processing
+        them so we avoid changing the Vector while looping through its items.
+
+        Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
+        which was added in r129670 for debugging purposes. In some situations, 
+        the scheduled animations map could be modified out from under some of the
+        functions of SMILTimeContainer.
+
+        Test: svg/animations/animate-and-remove-target-element.html
+
+        * svg/SVGAnimateElementBase.cpp:
+        (WebCore::SVGAnimateElementBase::resetAnimatedType):
+        (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
+        * svg/SVGAnimateElementBase.h:
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::createAnimator):
+        * svg/SVGElement.h:
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::schedule):
+        (WebCore::SMILTimeContainer::unschedule):
+        (WebCore::SMILTimeContainer::setElapsed):
+        (WebCore::SMILTimeContainer::sortByPriority):
+        (WebCore::SMILTimeContainer::processAnimations):
+        (WebCore::SMILTimeContainer::processScheduledAnimations):
+        (WebCore::SMILTimeContainer::updateAnimations):
+        (WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
+        * svg/animation/SMILTimeContainer.h:
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::calculateNextProgressTime const):
+        * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
+        * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
+        * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
+        * svg/properties/SVGAnimatedPropertyPairAnimator.h:
+        * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
+        * svg/properties/SVGAttributeAnimator.h:
+        * svg/properties/SVGMemberAccessor.h:
+        (WebCore::SVGMemberAccessor::createAnimator const):
+        * svg/properties/SVGPrimitivePropertyAnimator.h:
+        (WebCore::SVGPrimitivePropertyAnimator::create):
+        * svg/properties/SVGPropertyAnimatorFactory.h:
+        (WebCore::SVGPropertyAnimatorFactory::createAnimator):
+        * svg/properties/SVGPropertyOwnerRegistry.h:
+        * svg/properties/SVGPropertyRegistry.h:
+        * svg/properties/SVGValuePropertyAnimatorImpl.h:
+        * svg/properties/SVGValuePropertyListAnimatorImpl.h:
+
 2019-09-28  Zalan Bujtas  <za...@apple.com>
 
         [LFC][IFC] Move horizontal alignment to Line

Modified: trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (250487 => 250488)


--- trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp	2019-09-29 05:16:58 UTC (rev 250488)
@@ -151,8 +151,8 @@
     if (!targetElement())
         return;
 
-    if (auto* animator = this->animator())
-        animator->start(targetElement());
+    if (auto protectedAnimator = makeRefPtr(this->animator()))
+        protectedAnimator->start(targetElement());
 }
 
 void SVGAnimateElementBase::calculateAnimatedValue(float progress, unsigned repeatCount, SVGSMILElement*)
@@ -167,8 +167,8 @@
     if (calcMode() == CalcMode::Discrete)
         progress = progress < 0.5 ? 0 : 1;
 
-    if (auto* animator = this->animator())
-        animator->animate(targetElement(), progress, repeatCount);
+    if (auto protectedAnimator = makeRefPtr(this->animator()))
+        protectedAnimator->animate(targetElement(), progress, repeatCount);
 }
 
 void SVGAnimateElementBase::applyResultsToTarget()

Modified: trunk/Source/WebCore/svg/SVGAnimateElementBase.h (250487 => 250488)


--- trunk/Source/WebCore/svg/SVGAnimateElementBase.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -61,7 +61,7 @@
 
     bool hasInvalidCSSAttributeType() const;
 
-    mutable std::unique_ptr<SVGAttributeAnimator> m_animator;
+    mutable RefPtr<SVGAttributeAnimator> m_animator;
     mutable Optional<bool> m_hasInvalidCSSAttributeType;
 };
 

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (250487 => 250488)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2019-09-29 05:16:58 UTC (rev 250488)
@@ -604,7 +604,7 @@
     return SVGPropertyAnimatorFactory::isKnownAttribute(attributeName) || propertyRegistry().isAnimatedStylePropertyAttribute(attributeName);
 }
 
-std::unique_ptr<SVGAttributeAnimator> SVGElement::createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+RefPtr<SVGAttributeAnimator> SVGElement::createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
 {
     // Property animator, e.g. "fill" or "fill-opacity".
     if (auto animator = propertyAnimatorFactory().createAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive))

Modified: trunk/Source/WebCore/svg/SVGElement.h (250487 => 250488)


--- trunk/Source/WebCore/svg/SVGElement.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/SVGElement.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -141,7 +141,7 @@
 
     const SVGElement* attributeContextElement() const override { return this; }
     SVGPropertyAnimatorFactory& propertyAnimatorFactory() { return *m_propertyAnimatorFactory; }
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive);
+    RefPtr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive);
     void animatorWillBeDeleted(const QualifiedName&);
 
     // These are needed for the RenderTree, animation and DOM.

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp (250487 => 250488)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2019-09-29 05:16:58 UTC (rev 250488)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -44,13 +44,6 @@
 {
 }
 
-SMILTimeContainer::~SMILTimeContainer()
-{
-#ifndef NDEBUG
-    ASSERT(!m_preventScheduledAnimationsChanges);
-#endif
-}
-
 void SMILTimeContainer::schedule(SVGSMILElement* animation, SVGElement* target, const QualifiedName& attributeName)
 {
     ASSERT(animation->timeContainer() == this);
@@ -57,10 +50,6 @@
     ASSERT(target);
     ASSERT(animation->hasValidAttributeName());
 
-#ifndef NDEBUG
-    ASSERT(!m_preventScheduledAnimationsChanges);
-#endif
-
     ElementAttributePair key(target, attributeName);
     std::unique_ptr<AnimationsVector>& scheduled = m_scheduledAnimations.add(key, nullptr).iterator->value;
     if (!scheduled)
@@ -77,10 +66,6 @@
 {
     ASSERT(animation->timeContainer() == this);
 
-#ifndef NDEBUG
-    ASSERT(!m_preventScheduledAnimationsChanges);
-#endif
-
     ElementAttributePair key(target, attributeName);
     AnimationsVector* scheduled = m_scheduledAnimations.get(key);
     ASSERT(scheduled);
@@ -184,16 +169,9 @@
     } else
         m_resumeTime = m_beginTime;
 
-#ifndef NDEBUG
-    m_preventScheduledAnimationsChanges = true;
-#endif
-    for (auto& animation : m_scheduledAnimations.values()) {
-        for (auto& element : *animation)
-            element->reset();
-    }
-#ifndef NDEBUG
-    m_preventScheduledAnimationsChanges = false;
-#endif
+    processScheduledAnimations([](auto* animation) {
+        animation->reset();
+    });
 
     updateAnimations(time, true);
 }
@@ -244,86 +222,78 @@
     SMILTime m_elapsed;
 };
 
-void SMILTimeContainer::sortByPriority(Vector<SVGSMILElement*>& smilElements, SMILTime elapsed)
+void SMILTimeContainer::sortByPriority(AnimationsVector& animations, SMILTime elapsed)
 {
     if (m_documentOrderIndexesDirty)
         updateDocumentOrderIndexes();
-    std::sort(smilElements.begin(), smilElements.end(), PriorityCompare(elapsed));
+    std::sort(animations.begin(), animations.end(), PriorityCompare(elapsed));
 }
 
+void SMILTimeContainer::processAnimations(const AnimationsVector& animations, Function<void(SVGSMILElement*)>&& callback)
+{
+    // 'animations' may change if 'callback' causes an animation to end which will end up calling
+    // unschedule(). Copy 'animations' so none of the items gets deleted out from underneath us.
+    auto animationsCopy = animations;
+    for (auto* animation : animations)
+        callback(animation);
+}
+
+void SMILTimeContainer::processScheduledAnimations(Function<void(SVGSMILElement*)>&& callback)
+{
+    for (auto& it : m_scheduledAnimations)
+        processAnimations(*it.value, WTFMove(callback));
+}
+
 void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
 {
-    SMILTime earliestFireTime = SMILTime::unresolved();
-
     // Don't mutate the DOM while updating the animations.
     EventQueueScope scope;
-    
-#ifndef NDEBUG
-    // This boolean will catch any attempts to schedule/unschedule scheduledAnimations during this critical section.
-    // Similarly, any elements removed will unschedule themselves, so this will catch modification of animationsToApply.
-    m_preventScheduledAnimationsChanges = true;
-#endif
 
+    processScheduledAnimations([](auto* animation) {
+        if (!animation->hasConditionsConnected())
+            animation->connectConditions();
+    });
+
     AnimationsVector animationsToApply;
+    SMILTime earliestFireTime = SMILTime::unresolved();
+
     for (auto& it : m_scheduledAnimations) {
-        AnimationsVector* scheduled = it.value.get();
-        for (auto* animation : *scheduled) {
-            if (!animation->hasConditionsConnected())
-                animation->connectConditions();
-        }
-    }
-    
-    for (auto& it : m_scheduledAnimations) {
-        AnimationsVector* scheduled = it.value.get();
-
         // Sort according to priority. Elements with later begin time have higher priority.
-        // In case of a tie, document order decides. 
+        // In case of a tie, document order decides.
         // FIXME: This should also consider timing relationships between the elements. Dependents
         // have higher priority.
-        sortByPriority(*scheduled, elapsed);
+        sortByPriority(*it.value, elapsed);
 
-        RefPtr<SVGSMILElement> resultElement;
-        for (auto& animation : *scheduled) {
+        RefPtr<SVGSMILElement> firstAnimation;
+        processAnimations(*it.value, [&](auto* animation) {
             ASSERT(animation->timeContainer() == this);
             ASSERT(animation->targetElement());
             ASSERT(animation->hasValidAttributeName());
 
             // Results are accumulated to the first animation that animates and contributes to a particular element/attribute pair.
-            if (!resultElement) {
+            if (!firstAnimation) {
                 if (!animation->hasValidAttributeType())
-                    continue;
-                resultElement = animation;
+                    return;
+                firstAnimation = animation;
             }
 
             // This will calculate the contribution from the animation and add it to the resultsElement.
-            if (!animation->progress(elapsed, resultElement.get(), seekToTime) && resultElement == animation)
-                resultElement = nullptr;
+            if (!animation->progress(elapsed, firstAnimation.get(), seekToTime) && firstAnimation == animation)
+                firstAnimation = nullptr;
 
             SMILTime nextFireTime = animation->nextProgressTime();
             if (nextFireTime.isFinite())
                 earliestFireTime = std::min(nextFireTime, earliestFireTime);
-        }
+        });
 
-        if (resultElement)
-            animationsToApply.append(resultElement.get());
+        if (firstAnimation)
+            animationsToApply.append(firstAnimation.get());
     }
 
-    if (animationsToApply.isEmpty()) {
-#ifndef NDEBUG
-        m_preventScheduledAnimationsChanges = false;
-#endif
-        startTimer(elapsed, earliestFireTime, animationFrameDelay());
-        return;
-    }
-
     // Apply results to target elements.
     for (auto& animation : animationsToApply)
         animation->applyResultsToTarget();
 
-#ifndef NDEBUG
-    m_preventScheduledAnimationsChanges = false;
-#endif
-
     startTimer(elapsed, earliestFireTime, animationFrameDelay());
 }
 

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.h (250487 => 250488)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,7 +42,6 @@
 class SMILTimeContainer final : public RefCounted<SMILTimeContainer>  {
 public:
     static Ref<SMILTimeContainer> create(SVGSVGElement& owner) { return adoptRef(*new SMILTimeContainer(owner)); }
-    ~SMILTimeContainer();
 
     void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
     void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
@@ -69,9 +68,15 @@
     void timerFired();
     void startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay = 0);
     void updateAnimations(SMILTime elapsed, bool seekToTime = false);
-    
+
+    typedef std::pair<SVGElement*, QualifiedName> ElementAttributePair;
+    typedef Vector<SVGSMILElement*> AnimationsVector;
+    typedef HashMap<ElementAttributePair, std::unique_ptr<AnimationsVector>> GroupedAnimationsMap;
+
+    void processAnimations(const AnimationsVector&, Function<void(SVGSMILElement*)>&&);
+    void processScheduledAnimations(Function<void(SVGSMILElement*)>&&);
     void updateDocumentOrderIndexes();
-    void sortByPriority(Vector<SVGSMILElement*>& smilElements, SMILTime elapsed);
+    void sortByPriority(AnimationsVector& smilElements, SMILTime elapsed);
 
     MonotonicTime m_beginTime;
     MonotonicTime m_pauseTime;
@@ -80,19 +85,9 @@
     Seconds m_presetStartTime { 0_s };
 
     bool m_documentOrderIndexesDirty { false };
-    
     Timer m_timer;
-
-    typedef std::pair<SVGElement*, QualifiedName> ElementAttributePair;
-    typedef Vector<SVGSMILElement*> AnimationsVector;
-    typedef HashMap<ElementAttributePair, std::unique_ptr<AnimationsVector>> GroupedAnimationsMap;
     GroupedAnimationsMap m_scheduledAnimations;
-
     SVGSVGElement& m_ownerSVGElement;
-
-#ifndef NDEBUG
-    bool m_preventScheduledAnimationsChanges { false };
-#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (250487 => 250488)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2019-09-29 05:16:58 UTC (rev 250488)
@@ -1040,8 +1040,7 @@
     
 SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const
 {
-    ASSERT(m_timeContainer);
-    if (m_activeState == Active) {
+    if (m_timeContainer && m_activeState == Active) {
         // If duration is indefinite the value does not actually change over time. Same is true for <set>.
         SMILTime simpleDuration = this->simpleDuration();
         if (simpleDuration.isIndefinite() || hasTagName(SVGNames::setTag)) {

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -53,7 +53,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedBooleanAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedBooleanAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -75,7 +75,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedEnumerationAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedEnumerationAnimator<EnumType>::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -97,7 +97,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedIntegerAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedIntegerAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -121,7 +121,7 @@
 private:
     bool isAnimatedLength() const override { return true; }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         SVGLengthMode lengthMode = property(owner)->baseVal()->value().lengthMode();
         return SVGAnimatedLengthAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive, lengthMode);
@@ -144,7 +144,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedLengthListAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedLengthListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive, SVGLengthMode::Width);
     }
@@ -166,7 +166,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedNumberAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -188,7 +188,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberListAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedNumberListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -210,7 +210,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPathSegListAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedPathSegListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -232,7 +232,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPointListAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedPointListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -264,7 +264,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPreserveAspectRatioAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedPreserveAspectRatioAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -286,7 +286,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedRectAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedRectAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -308,7 +308,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedStringAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedStringAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -330,7 +330,7 @@
     constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedTransformListAccessor, property>(); }
 
 private:
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedTransformListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -50,7 +50,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedAngle>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedAngleAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedAngleAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -68,7 +68,7 @@
 
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedBoolean>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedBooleanAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedBooleanAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -89,7 +89,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedEnumeration>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedEnumerationAnimator<EnumType>>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedEnumerationAnimator<EnumType>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -111,7 +111,7 @@
 
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedInteger>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedIntegerAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedIntegerAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -132,7 +132,7 @@
 
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedLength>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode)
     {
-        return makeUnique<SVGAnimatedLengthAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode);
+        return adoptRef(*new SVGAnimatedLengthAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode));
     }
 
 private:
@@ -153,7 +153,7 @@
 
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedLengthList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode)
     {
-        return makeUnique<SVGAnimatedLengthListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode);
+        return adoptRef(*new SVGAnimatedLengthListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode));
     }
 
 private:
@@ -172,7 +172,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedNumberAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedNumberAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -189,7 +189,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumberList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedNumberListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedNumberListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
     
 private:
@@ -206,7 +206,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPathSegList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedPathSegListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedPathSegListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -224,7 +224,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPointList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedPointListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedPointListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
     
 private:
@@ -243,7 +243,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedOrientType>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedOrientTypeAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedOrientTypeAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -262,7 +262,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPreserveAspectRatio>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedPreserveAspectRatioAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedPreserveAspectRatioAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -281,7 +281,7 @@
 
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedRect>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedRectAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedRectAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -298,7 +298,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedString>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedStringAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedStringAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -338,7 +338,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedTransformList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedTransformListAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedTransformListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -60,7 +60,7 @@
         return type == SVGMarkerOrientAuto || type == SVGMarkerOrientAutoStartReverse ? string2 : string1;
     }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedAngleOrientAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -95,7 +95,7 @@
         return string1 == string2 ? string1 : string1 + ", " + string2;
     }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedIntegerPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }
@@ -130,7 +130,7 @@
         return string1 == string2 ? string1 : string1 + ", " + string2;
     }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    RefPtr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     {
         return SVGAnimatedNumberPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive);
     }

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -74,8 +74,8 @@
         m_animatedPropertyAnimator2->stop(targetElement);
     }
 
-    std::unique_ptr<AnimatedPropertyAnimator1> m_animatedPropertyAnimator1;
-    std::unique_ptr<AnimatedPropertyAnimator2> m_animatedPropertyAnimator2;
+    Ref<AnimatedPropertyAnimator1> m_animatedPropertyAnimator1;
+    Ref<AnimatedPropertyAnimator2> m_animatedPropertyAnimator2;
 };
 
 }

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -40,7 +40,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedAngle>& animated1, Ref<SVGAnimatedOrientType>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedAngleOrientAnimator>(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedAngleOrientAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -113,7 +113,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedInteger>& animated1, Ref<SVGAnimatedInteger>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedIntegerPairAnimator>(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedIntegerPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:
@@ -156,7 +156,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated1, Ref<SVGAnimatedNumber>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGAnimatedNumberPairAnimator>(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGAnimatedNumberPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive));
     }
 
 private:

Modified: trunk/Source/WebCore/svg/properties/SVGAttributeAnimator.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGAttributeAnimator.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGAttributeAnimator.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -51,7 +51,7 @@
     Spline
 };
 
-class SVGAttributeAnimator {
+class SVGAttributeAnimator : public RefCounted<SVGAttributeAnimator> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     SVGAttributeAnimator(const QualifiedName& attributeName)

Modified: trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -47,7 +47,7 @@
     virtual bool matches(const OwnerType&, const SVGAnimatedProperty&) const { return false; }
     virtual Optional<String> synchronize(const OwnerType&) const { return WTF::nullopt; }
 
-    virtual std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType&, const QualifiedName&, AnimationMode, CalcMode, bool, bool) const { return nullptr; }
+    virtual RefPtr<SVGAttributeAnimator> createAnimator(OwnerType&, const QualifiedName&, AnimationMode, CalcMode, bool, bool) const { return nullptr; }
     virtual void appendAnimatedInstance(OwnerType&, SVGAttributeAnimator&) const { }
 
 protected:

Modified: trunk/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -44,7 +44,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGProperty>&& property, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGPrimitivePropertyAnimator>(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive);
+        return adoptRef(*new SVGPrimitivePropertyAnimator(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive));
     }
     
     template<typename... Arguments>

Modified: trunk/Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -43,7 +43,7 @@
         return attributeAnimatorCreator().contains(attributeName.impl());
     }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+    RefPtr<SVGAttributeAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
         auto iterator = attributeAnimatorCreator().find(attributeName.impl());
         if (iterator == attributeAnimatorCreator().end())
@@ -75,7 +75,7 @@
         QualifiedName::QualifiedNameImpl*,
         std::pair<
             std::function<Ref<SVGProperty>()>,
-            std::function<std::unique_ptr<SVGAttributeAnimator>(const QualifiedName&, Ref<SVGProperty>&&, AnimationMode, CalcMode, bool, bool)>
+            std::function<Ref<SVGAttributeAnimator>(const QualifiedName&, Ref<SVGProperty>&&, AnimationMode, CalcMode, bool, bool)>
         >
     >;
 

Modified: trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -266,9 +266,9 @@
         return isAnimatedLengthAttribute(attributeName) && animatedStyleAttributes.get().contains(attributeName.impl());
     }
 
-    std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const override
+    RefPtr<SVGAttributeAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const override
     {
-        std::unique_ptr<SVGAttributeAnimator> animator;
+        RefPtr<SVGAttributeAnimator> animator;
         enumerateRecursively([&](const auto& entry) -> bool {
             if (!entry.key.matches(attributeName))
                 return true;

Modified: trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -44,7 +44,7 @@
 
     virtual bool isAnimatedPropertyAttribute(const QualifiedName&) const = 0;
     virtual bool isAnimatedStylePropertyAttribute(const QualifiedName&) const = 0;
-    virtual std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive) const = 0;
+    virtual RefPtr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive) const = 0;
     virtual void appendAnimatedInstance(const QualifiedName& attributeName, SVGAttributeAnimator&) const = 0;
 };
 

Modified: trunk/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -39,7 +39,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGProperty>&& property, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGLengthAnimator>(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive, SVGLengthMode::Other);
+        return adoptRef(*new SVGLengthAnimator(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive, SVGLengthMode::Other));
     }
 
     void start(SVGElement* targetElement) override

Modified: trunk/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h (250487 => 250488)


--- trunk/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h	2019-09-29 01:59:27 UTC (rev 250487)
+++ trunk/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h	2019-09-29 05:16:58 UTC (rev 250488)
@@ -39,7 +39,7 @@
 public:
     static auto create(const QualifiedName& attributeName, Ref<SVGProperty>&& property, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     {
-        return makeUnique<SVGLengthListAnimator>(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive, SVGLengthMode::Other);
+        return adoptRef(*new SVGLengthListAnimator(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive, SVGLengthMode::Other));
     }
 
     void start(SVGElement* targetElement) override
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to