Changeset 233585 in webkit
- Timestamp:
- Jul 6, 2018, 11:43:57 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/AnimationTimeline.cpp (modified) (4 diffs)
-
Source/WebCore/animation/AnimationTimeline.h (modified) (2 diffs)
-
Source/WebCore/animation/DocumentTimeline.cpp (modified) (1 diff)
-
Source/WebCore/animation/WebAnimation.cpp (modified) (1 diff)
-
Source/WebCore/animation/WebAnimation.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r233584 r233585 1 2018-07-05 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably 4 https://bugs.webkit.org/show_bug.cgi?id=186496 5 <rdar://problem/41000179> 6 7 Reviewed by Dean Jackson. 8 9 Mark a WPT progression. 10 11 * web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt: 12 1 13 2018-07-05 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt
r233519 r233585 14 14 PASS Test finish() resolves finished promise synchronously 15 15 PASS Test finish() resolves finished promise synchronously with an animation without a target 16 FAIL Test normally finished animation resolves finished promise synchronously with an animation without a target assert_true: Animation.finished should be resolved soon after Animation finishes normally expected true got false 16 PASS Test normally finished animation resolves finished promise synchronously with an animation without a target 17 17 -
trunk/Source/WebCore/ChangeLog
r233584 r233585 1 2018-07-05 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably 4 https://bugs.webkit.org/show_bug.cgi?id=186496 5 <rdar://problem/41000179> 6 7 Reviewed by Dean Jackson. 8 9 We used to only resolve animations that had a target element, but animations need not have a target and their 10 current time should still advance so that their finished promise may resolve. We now maintain a list of animations 11 without targets and we iterate through them as well as animations with targets in DocumentTimeline::updateAnimations(). 12 13 * animation/AnimationTimeline.cpp: 14 (WebCore::AnimationTimeline::addAnimation): 15 (WebCore::AnimationTimeline::removeAnimation): 16 (WebCore::AnimationTimeline::animationWasAddedToElement): 17 (WebCore::AnimationTimeline::animationWasRemovedFromElement): 18 * animation/AnimationTimeline.h: 19 (WebCore::AnimationTimeline:: const): 20 * animation/DocumentTimeline.cpp: 21 (WebCore::DocumentTimeline::updateAnimations): 22 * animation/WebAnimation.cpp: 23 (WebCore::WebAnimation::resolve): 24 * animation/WebAnimation.h: 25 1 26 2018-07-05 Antoine Quint <graouts@apple.com> 2 27 -
trunk/Source/WebCore/animation/AnimationTimeline.cpp
r233583 r233585 57 57 void AnimationTimeline::addAnimation(Ref<WebAnimation>&& animation) 58 58 { 59 m_animationsWithoutTarget.add(animation.ptr()); 59 60 m_animations.add(WTFMove(animation)); 60 61 timingModelDidChange(); … … 63 64 void AnimationTimeline::removeAnimation(Ref<WebAnimation>&& animation) 64 65 { 66 m_animationsWithoutTarget.remove(animation.ptr()); 65 67 m_animations.remove(WTFMove(animation)); 66 68 timingModelDidChange(); … … 92 94 void AnimationTimeline::animationWasAddedToElement(WebAnimation& animation, Element& element) 93 95 { 96 m_animationsWithoutTarget.remove(&animation); 97 94 98 relevantMapForAnimation(animation).ensure(&element, [] { 95 99 return ListHashSet<RefPtr<WebAnimation>> { }; … … 112 116 void AnimationTimeline::animationWasRemovedFromElement(WebAnimation& animation, Element& element) 113 117 { 118 // This animation doesn't have a target for now. 119 m_animationsWithoutTarget.add(&animation); 120 114 121 // First, we clear this animation from one of the m_elementToCSSAnimationsMap, m_elementToCSSTransitionsMap, 115 122 // m_elementToAnimationsMap or m_elementToCompletedCSSTransitionByCSSPropertyID map, whichever is relevant to -
trunk/Source/WebCore/animation/AnimationTimeline.h
r233189 r233585 82 82 bool hasElementAnimations() const { return !m_elementToAnimationsMap.isEmpty() || !m_elementToCSSAnimationsMap.isEmpty() || !m_elementToCSSTransitionsMap.isEmpty(); } 83 83 84 const ListHashSet<WebAnimation*>& animationsWithoutTarget() const { return m_animationsWithoutTarget; } 84 85 const HashMap<Element*, ListHashSet<RefPtr<WebAnimation>>>& elementToAnimationsMap() { return m_elementToAnimationsMap; } 85 86 const HashMap<Element*, ListHashSet<RefPtr<WebAnimation>>>& elementToCSSAnimationsMap() { return m_elementToCSSAnimationsMap; } … … 98 99 ListHashSet<RefPtr<WebAnimation>> m_animations; 99 100 101 ListHashSet<WebAnimation*> m_animationsWithoutTarget; 100 102 HashMap<Element*, HashMap<String, RefPtr<CSSAnimation>>> m_elementToCSSAnimationByName; 101 103 HashMap<Element*, HashMap<CSSPropertyID, RefPtr<CSSTransition>>> m_elementToRunningCSSTransitionByCSSPropertyID; -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r233583 r233585 281 281 MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint(); 282 282 283 // Let's first resolve any animation that does not have a target. 284 for (auto* animation : animationsWithoutTarget()) 285 animation->resolve(); 286 287 // For the rest of the animations, we will resolve them via TreeResolver::createAnimatedElementUpdate() 288 // by invalidating their target element's style. 283 289 if (m_document && hasElementAnimations()) { 284 290 for (const auto& elementToAnimationsMapItem : elementToAnimationsMap()) -
trunk/Source/WebCore/animation/WebAnimation.cpp
r233584 r233585 1056 1056 } 1057 1057 1058 void WebAnimation::resolve() 1059 { 1060 updateFinishedState(DidSeek::No, SynchronouslyNotify::Yes); 1061 } 1062 1058 1063 void WebAnimation::resolve(RenderStyle& targetStyle) 1059 1064 { 1060 updateFinishedState(DidSeek::No, SynchronouslyNotify::Yes); 1061 1065 resolve(); 1062 1066 if (m_effect) 1063 1067 m_effect->apply(targetStyle); -
trunk/Source/WebCore/animation/WebAnimation.h
r233584 r233585 106 106 107 107 Seconds timeToNextRequiredTick() const; 108 void resolve(); 108 109 virtual void resolve(RenderStyle&); 109 110 void runPendingTasks();
Note:
See TracChangeset
for help on using the changeset viewer.