⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243263 in webkit


Ignore:
Timestamp:
Mar 20, 2019, 5:14:04 PM (7 years ago)
Author:
graouts@webkit.org
Message:

DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=196028
<rdar://problem/46842707>

Reviewed by Dean Jackson.

Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.

  • animation/AnimationTimeline.cpp:

(WebCore::AnimationTimeline::forgetAnimation):
(WebCore::AnimationTimeline::animationTimingDidChange):
(WebCore::AnimationTimeline::cancelDeclarativeAnimation):

  • animation/AnimationTimeline.h:
  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::getAnimations const):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243259 r243263  
     12019-03-20  Antoine Quint  <graouts@apple.com>
     2
     3        DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
     4        https://bugs.webkit.org/show_bug.cgi?id=196028
     5        <rdar://problem/46842707>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
     10
     11        * animation/AnimationTimeline.cpp:
     12        (WebCore::AnimationTimeline::forgetAnimation):
     13        (WebCore::AnimationTimeline::animationTimingDidChange):
     14        (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
     15        * animation/AnimationTimeline.h:
     16        * animation/DocumentTimeline.cpp:
     17        (WebCore::DocumentTimeline::getAnimations const):
     18
    1192019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
    220
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r239820 r243263  
    5757void AnimationTimeline::forgetAnimation(WebAnimation* animation)
    5858{
    59     m_allAnimations.remove(animation);
     59    m_allAnimations.removeFirst(animation);
    6060}
    6161
     
    6363{
    6464    if (m_animations.add(&animation)) {
    65         m_allAnimations.add(&animation);
     65        m_allAnimations.append(makeWeakPtr(&animation));
    6666        auto* timeline = animation.timeline();
    6767        if (timeline && timeline != this)
     
    493493    animation.cancelFromStyle();
    494494    removeAnimation(animation);
    495     m_allAnimations.remove(&animation);
     495    m_allAnimations.removeFirst(&animation);
    496496}
    497497
  • trunk/Source/WebCore/animation/AnimationTimeline.h

    r239820 r243263  
    7878    explicit AnimationTimeline();
    7979
    80     ListHashSet<WebAnimation*> m_allAnimations;
     80    Vector<WeakPtr<WebAnimation>> m_allAnimations;
    8181    ListHashSet<RefPtr<WebAnimation>> m_animations;
    8282    HashMap<Element*, PropertyToTransitionMap> m_elementToCompletedCSSTransitionByCSSPropertyID;
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r242714 r243263  
    133133    // First, let's get all qualifying animations in their right group.
    134134    for (const auto& animation : m_allAnimations) {
    135         if (!animation->isRelevant() || animation->timeline() != this || !is<KeyframeEffect>(animation->effect()))
     135        if (!animation || !animation->isRelevant() || animation->timeline() != this || !is<KeyframeEffect>(animation->effect()))
    136136            continue;
    137137
     
    140140            continue;
    141141
    142         if (is<CSSTransition>(animation) && downcast<CSSTransition>(animation)->owningElement())
    143             cssTransitions.append(animation);
    144         else if (is<CSSAnimation>(animation) && downcast<CSSAnimation>(animation)->owningElement())
    145             cssAnimations.append(animation);
     142        if (is<CSSTransition>(animation.get()) && downcast<CSSTransition>(animation.get())->owningElement())
     143            cssTransitions.append(animation.get());
     144        else if (is<CSSAnimation>(animation.get()) && downcast<CSSAnimation>(animation.get())->owningElement())
     145            cssAnimations.append(animation.get());
    146146        else
    147             webAnimations.append(animation);
     147            webAnimations.append(animation.get());
    148148    }
    149149
Note: See TracChangeset for help on using the changeset viewer.