Changeset 258823 in webkit


Ignore:
Timestamp:
Mar 22, 2020 3:57:22 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[ Mac ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209239
<rdar://problem/60591358>

Patch by Antoine Quint <Antoine Quint> on 2020-03-22
Reviewed by Simon Fraser.

Source/WebCore:

This test was made flaky by r257417, the initial fix for webkit.org/b/208069. A new, appropriate fix for that bug is in the works. In the
meantime we revert r257417 in this patch.

The reason this test became flaky is that it features the following code:

animB.timeline = new DocumentTimeline({

originTime:

document.timeline.currentTime - 100 * MS_PER_SEC - animB.startTime,

});

In this case the only reference to the created DocumentTimeline is through animB.timeline. But because r257417 made the timeline reference from
WebAnimation a weak reference, in some cases, if GC kicks in, the timeline would be dereferenced and the test would fail. We restore that relationship
to its previous state, which is a strong reference.

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::enqueueAnimationEvent):
(WebCore::WebAnimation::acceleratedStateDidChange):
(WebCore::WebAnimation::timeline const): Deleted.

  • animation/WebAnimation.h:

(WebCore::WebAnimation::timeline const):

LayoutTests:

  • platform/mac/TestExpectations:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r258822 r258823  
     12020-03-22  Antoine Quint  <graouts@apple.com>
     2
     3        [ Mac ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html is flaky failing.
     4        https://bugs.webkit.org/show_bug.cgi?id=209239
     5        <rdar://problem/60591358>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * platform/mac/TestExpectations:
     10
    1112020-03-22  Diego Pino Garcia  <dpino@igalia.com>
    212
  • trunk/LayoutTests/platform/mac/TestExpectations

    r258797 r258823  
    20332033webkit.org/b/207150 platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html [ Pass Failure ]
    20342034
    2035 webkit.org/b/209239 imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html [ Pass Failure ]
    2036 
    20372035# The line breaking rules changed in ICU 66. We've updated the tests to match, but old platforms won't get updated line breaking rules.
    20382036webkit.org/b/209250 [ Sierra+ ] imported/w3c/web-platform-tests/css/css-text/line-break/line-break-normal-015.xht [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r258820 r258823  
     12020-03-22  Antoine Quint  <graouts@apple.com>
     2
     3        [ Mac ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html is flaky failing.
     4        https://bugs.webkit.org/show_bug.cgi?id=209239
     5        <rdar://problem/60591358>
     6
     7        Reviewed by Simon Fraser.
     8
     9        This test was made flaky by r257417, the initial fix for webkit.org/b/208069. A new, appropriate fix for that bug is in the works. In the
     10        meantime we revert r257417 in this patch.
     11
     12        The reason this test became flaky is that it features the following code:
     13
     14            animB.timeline = new DocumentTimeline({
     15              originTime:
     16                document.timeline.currentTime - 100 * MS_PER_SEC - animB.startTime,
     17            });
     18
     19        In this case the only reference to the created DocumentTimeline is through `animB.timeline`. But because r257417 made the timeline reference from
     20        WebAnimation a weak reference, in some cases, if GC kicks in, the timeline would be dereferenced and the test would fail. We restore that relationship
     21        to its previous state, which is a strong reference.
     22
     23        * animation/WebAnimation.cpp:
     24        (WebCore::WebAnimation::setTimeline):
     25        (WebCore::WebAnimation::setTimelineInternal):
     26        (WebCore::WebAnimation::enqueueAnimationEvent):
     27        (WebCore::WebAnimation::acceleratedStateDidChange):
     28        (WebCore::WebAnimation::timeline const): Deleted.
     29        * animation/WebAnimation.h:
     30        (WebCore::WebAnimation::timeline const):
     31
    1322020-03-22  Zalan Bujtas  <zalan@apple.com>
    233
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r258702 r258823  
    190190}
    191191
    192 AnimationTimeline* WebAnimation::timeline() const
    193 {
    194     return m_timeline.get();
    195 }
    196 
    197192void WebAnimation::setEffectInternal(RefPtr<AnimationEffect>&& newEffect, bool doNotRemoveFromTimeline)
    198193{
     
    233228
    234229    // 2. If new timeline is the same object as old timeline, abort this procedure.
    235     if (timeline == m_timeline.get())
     230    if (timeline == m_timeline)
    236231        return;
    237232
     
    258253    setTimelineInternal(WTFMove(timeline));
    259254
    260     setSuspended(is<DocumentTimeline>(m_timeline.get()) && downcast<DocumentTimeline>(*m_timeline).animationsAreSuspended());
     255    setSuspended(is<DocumentTimeline>(m_timeline) && downcast<DocumentTimeline>(*m_timeline).animationsAreSuspended());
    261256
    262257    // 5. Run the procedure to update an animation's finished state for animation with the did seek flag set to false,
     
    269264void WebAnimation::setTimelineInternal(RefPtr<AnimationTimeline>&& timeline)
    270265{
    271     if (m_timeline.get() == timeline)
     266    if (m_timeline == timeline)
    272267        return;
    273268
     
    275270        m_timeline->removeAnimation(*this);
    276271
    277     m_timeline = makeWeakPtr(timeline.get());
     272    m_timeline = WTFMove(timeline);
    278273
    279274    if (m_effect)
     
    684679void WebAnimation::enqueueAnimationEvent(Ref<AnimationEventBase>&& event)
    685680{
    686     if (is<DocumentTimeline>(m_timeline.get())) {
     681    if (is<DocumentTimeline>(m_timeline)) {
    687682        // If animation has a document for timing, then append event to its document for timing's pending animation event queue along
    688683        // with its target, animation. If animation is associated with an active timeline that defines a procedure to convert timeline times
     
    12401235void WebAnimation::acceleratedStateDidChange()
    12411236{
    1242     if (is<DocumentTimeline>(m_timeline.get()))
     1237    if (is<DocumentTimeline>(m_timeline))
    12431238        downcast<DocumentTimeline>(*m_timeline).animationAcceleratedRunningStateDidChange(*this);
    12441239}
  • trunk/Source/WebCore/animation/WebAnimation.h

    r258316 r258823  
    6969    AnimationEffect* effect() const { return m_effect.get(); }
    7070    void setEffect(RefPtr<AnimationEffect>&&);
    71     AnimationTimeline* timeline() const;
     71    AnimationTimeline* timeline() const { return m_timeline.get(); }
    7272    virtual void setTimeline(RefPtr<AnimationTimeline>&&);
    7373
     
    187187
    188188    RefPtr<AnimationEffect> m_effect;
    189     WeakPtr<AnimationTimeline> m_timeline;
     189    RefPtr<AnimationTimeline> m_timeline;
    190190    UniqueRef<ReadyPromise> m_readyPromise;
    191191    UniqueRef<FinishedPromise> m_finishedPromise;
Note: See TracChangeset for help on using the changeset viewer.