Changeset 110591 in webkit


Ignore:
Timestamp:
Mar 13, 2012 12:27:51 PM (12 years ago)
Author:
Nikolas Zimmermann
Message:

SVG Animations update baseVal instead of animVal
https://bugs.webkit.org/show_bug.cgi?id=12437

Reviewed by Dirk Schulze.

Blind fix for some GC related assertions firing on v8.

Assure that animationStarted/animationEnded calls are happening
on the same SVGAnimatedProperty. Always call animationEnded(),
even if we shouldn't do anything for the target element, as its
destructed, as we still have to reset m_isAnimating.

  • svg/SVGAnimateElement.cpp:

(WebCore::SVGAnimateElement::SVGAnimateElement):
(WebCore::SVGAnimateElement::resetToBaseValue):
(WebCore::SVGAnimateElement::targetElementWillChange):

  • svg/SVGAnimateElement.h:

(SVGAnimateElement):

  • svg/properties/SVGAnimatedPropertyTearOff.h:

(WebCore::SVGAnimatedPropertyTearOff::animationEnded):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110589 r110591  
     12012-03-13  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        SVG Animations update baseVal instead of animVal
     4        https://bugs.webkit.org/show_bug.cgi?id=12437
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Blind fix for some GC related assertions firing on v8.
     9
     10        Assure that animationStarted/animationEnded calls are happening
     11        on the same SVGAnimatedProperty. Always call animationEnded(),
     12        even if we shouldn't do anything for the target element, as its
     13        destructed, as we still have to reset m_isAnimating.
     14
     15        * svg/SVGAnimateElement.cpp:
     16        (WebCore::SVGAnimateElement::SVGAnimateElement):
     17        (WebCore::SVGAnimateElement::resetToBaseValue):
     18        (WebCore::SVGAnimateElement::targetElementWillChange):
     19        * svg/SVGAnimateElement.h:
     20        (SVGAnimateElement):
     21        * svg/properties/SVGAnimatedPropertyTearOff.h:
     22        (WebCore::SVGAnimatedPropertyTearOff::animationEnded):
     23
    1242012-03-13  Mark Pilgrim  <pilgrim@chromium.org>
    225
  • trunk/Source/WebCore/svg/SVGAnimateElement.cpp

    r110545 r110591  
    4242    , m_fromPropertyValueType(RegularPropertyValue)
    4343    , m_toPropertyValueType(RegularPropertyValue)
     44    , m_animatedProperty(0)
    4445{
    4546    ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag));
     
    220221    // SVG DOM primitives, like SVGLength.
    221222    SVGAnimatedTypeAnimator* animator = ensureAnimator();
    222     if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(animator->type())) {
     223    m_animatedProperty = animatedPropertyForType(animator->type());
     224    if (m_animatedProperty) {
    223225        if (!m_animatedType) {
    224             m_animatedType = animator->constructFromCopy(animatedProperty->currentBaseValue(animator->type()));
    225             animationStarted(animatedProperty, m_animatedType.get());
     226            m_animatedType = animator->constructFromCopy(m_animatedProperty->currentBaseValue(animator->type()));
     227            animationStarted(m_animatedProperty, m_animatedType.get());
    226228        } else
    227             m_animatedType->setVariantValue(animatedProperty->currentBaseValue(m_animator->type()));
     229            m_animatedType->setVariantValue(m_animatedProperty->currentBaseValue(m_animator->type()));
    228230        ASSERT(m_animatedPropertyType == animator->type());
     231        ASSERT(m_animatedPropertyType == m_animatedProperty->animatedPropertyType());
    229232        return;
    230233    }
     
    260263    SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
    261264
    262     // Be sure to never execute any of this, while the target element is being removed from the document or destructed.
    263     if (currentTarget && currentTarget->inDocument() && currentTarget->parentNode()) {
    264         ASSERT(!currentTarget->m_deletionHasBegun);
    265         if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(m_animatedPropertyType))
    266             animationEnded(animatedProperty);
     265    if (m_animatedProperty) {
     266        animationEnded(m_animatedProperty);
     267        m_animatedProperty = 0;
    267268    }
    268269
  • trunk/Source/WebCore/svg/SVGAnimateElement.h

    r110545 r110591  
    4141};
    4242
     43class SVGAnimatedProperty;
     44
    4345class SVGAnimateElement : public SVGAnimationElement {
    4446public:
     
    8082    OwnPtr<SVGAnimatedType> m_toType;
    8183    OwnPtr<SVGAnimatedType> m_animatedType;
    82    
     84
     85    SVGAnimatedProperty* m_animatedProperty;
    8386    OwnPtr<SVGAnimatedTypeAnimator> m_animator;
    8487};
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h

    r110545 r110591  
    8080        m_isAnimating = false;
    8181
    82         ASSERT(contextElement());
    83         contextElement()->svgAttributeChanged(attributeName());
     82        SVGElement* element = contextElement();
     83        if (!element || !element->inDocument() || !element->parentNode())
     84            return;
     85        ASSERT(!element->m_deletionHasBegun);
     86        element->svgAttributeChanged(attributeName());
    8487    }
    8588
Note: See TracChangeset for help on using the changeset viewer.