Changeset 258702 in webkit
- Timestamp:
- Mar 19, 2020 9:42:24 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r258661 r258702 1 2020-03-19 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Mark promises as handled when rejected 4 https://bugs.webkit.org/show_bug.cgi?id=209240 5 <rdar://problem/60592305> 6 7 Reviewed by Youenn Fablet. 8 9 Add the new WPT tests added for this spec change (https://github.com/web-platform-tests/wpt/pull/22314) and revert some workarounds 10 made in our copy of WPT tests to previously silence flaky console output related to promise rejections (added in r258275 and r258276). 11 12 * web-platform-tests/web-animations/interfaces/Animation/finished-expected.txt: 13 * web-platform-tests/web-animations/interfaces/Animation/finished.html: 14 * web-platform-tests/web-animations/interfaces/Animation/ready-expected.txt: 15 * web-platform-tests/web-animations/interfaces/Animation/ready.html: 16 * web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html: 17 * web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html: 18 1 19 2020-03-18 Frank Yang <guowei_yang@apple.com> 2 20 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/finished-expected.txt
r233584 r258702 21 21 PASS Finished promise should be resolved after the ready promise is resolved 22 22 PASS Finished promise should be rejected after the ready promise is rejected 23 PASS Finished promise does not report an unhandledrejection when rejected 23 24 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/finished.html
r237857 r258702 396 396 }, 'Finished promise should be rejected after the ready promise is rejected'); 397 397 398 promise_test(async t => { 399 const animation = createDiv(t).animate(null, 100 * MS_PER_SEC); 400 401 // Ensure the finished promise is created 402 const finished = animation.finished; 403 404 window.addEventListener( 405 'unhandledrejection', 406 t.unreached_func('Should not get an unhandled rejection') 407 ); 408 409 animation.cancel(); 410 411 // Wait a moment to allow a chance for the event to be dispatched. 412 await waitForAnimationFrames(2); 413 }, 'Finished promise does not report an unhandledrejection when rejected'); 414 398 415 </script> 399 416 </body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/ready-expected.txt
r227598 r258702 3 3 PASS Redundant calls to play() do not generate new ready promise objects 4 4 PASS The ready promise is fulfilled with its Animation 5 PASS The ready promise does not report an unhandledrejection when rejected 5 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/ready.html
r237857 r258702 58 58 }, 'The ready promise is fulfilled with its Animation'); 59 59 60 promise_test(async t => { 61 const animation = createDiv(t).animate(null, 100 * MS_PER_SEC); 62 63 // Ensure the ready promise is created 64 const ready = animation.ready; 65 66 window.addEventListener( 67 'unhandledrejection', 68 t.unreached_func('Should not get an unhandled rejection') 69 ); 70 71 animation.cancel(); 72 73 // Wait a moment to allow a chance for the event to be dispatched. 74 await waitForAnimationFrames(2); 75 }, 'The ready promise does not report an unhandledrejection when rejected'); 76 60 77 </script> 61 78 </body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html
r258275 r258702 305 305 await animation.ready; 306 306 307 const originalFinishPromise = animation.finished .catch(() => {});307 const originalFinishPromise = animation.finished; 308 308 309 309 animation.cancel(); -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html
r258276 r258702 95 95 const animation = createDiv(t).animate(null, 100 * MS_PER_SEC); 96 96 97 const originalReadyPromise = animation.ready .catch(() => {});97 const originalReadyPromise = animation.ready; 98 98 animation.cancel(); 99 99 assert_equals(animation.startTime, null); -
trunk/Source/WebCore/ChangeLog
r258698 r258702 1 2020-03-19 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Mark promises as handled when rejected 4 https://bugs.webkit.org/show_bug.cgi?id=209240 5 <rdar://problem/60592305> 6 7 Reviewed by Youenn Fablet. 8 9 Implementing the spec change discussed in https://github.com/w3c/csswg-drafts/issues/4556. 10 11 * animation/WebAnimation.cpp: 12 (WebCore::WebAnimation::cancel): 13 (WebCore::WebAnimation::resetPendingTasks): 14 1 15 2020-03-19 Charlie Turner <cturner@igalia.com> 2 16 -
trunk/Source/WebCore/animation/WebAnimation.cpp
r258274 r258702 633 633 634 634 // 2. Reject the current finished promise with a DOMException named "AbortError". 635 // 3. Set the [[PromiseIsHandled]] internal slot of the current finished promise to true. 635 636 if (silently == Silently::No && !m_finishedPromise->isFulfilled()) 636 m_finishedPromise->reject(Exception { AbortError } );637 638 // 3. Let current finished promise be a new (pending) Promise object.637 m_finishedPromise->reject(Exception { AbortError }, RejectAsHandled::Yes); 638 639 // 4. Let current finished promise be a new (pending) Promise object. 639 640 m_finishedPromise = makeUniqueRef<FinishedPromise>(*this, &WebAnimation::finishedPromiseResolve); 640 641 641 // 4. Create an AnimationPlaybackEvent, cancelEvent.642 // 5. Set cancelEvent's type attribute to cancel.643 // 6. Set cancelEvent's currentTime to null.644 // 7. Let timeline time be the current time of the timeline with which animation is associated. If animation is not associated with an642 // 5. Create an AnimationPlaybackEvent, cancelEvent. 643 // 6. Set cancelEvent's type attribute to cancel. 644 // 7. Set cancelEvent's currentTime to null. 645 // 8. Let timeline time be the current time of the timeline with which animation is associated. If animation is not associated with an 645 646 // active timeline, let timeline time be n unresolved time value. 646 // 8. Set cancelEvent's timelineTime to timeline time. If timeline time is unresolved, set it to null.647 // 9. If animation has a document for timing, then append cancelEvent to its document for timing's pending animation event queue along647 // 9. Set cancelEvent's timelineTime to timeline time. If timeline time is unresolved, set it to null. 648 // 10. If animation has a document for timing, then append cancelEvent to its document for timing's pending animation event queue along 648 649 // with its target, animation. If animation is associated with an active timeline that defines a procedure to convert timeline times 649 650 // to origin-relative time, let the scheduled event time be the result of applying that procedure to timeline time. Otherwise, the … … 717 718 718 719 // 5. Reject animation's current ready promise with a DOMException named "AbortError". 720 // 6. Set the [[PromiseIsHandled]] internal slot of animation’s current ready promise to true. 719 721 if (silently == Silently::No) 720 m_readyPromise->reject(Exception { AbortError } );721 722 // 6. Let animation's current ready promise be the result of creating a new resolved Promise object.722 m_readyPromise->reject(Exception { AbortError }, RejectAsHandled::Yes); 723 724 // 7. Let animation's current ready promise be the result of creating a new resolved Promise object. 723 725 m_readyPromise = makeUniqueRef<ReadyPromise>(*this, &WebAnimation::readyPromiseResolve); 724 726 m_readyPromise->resolve(*this);
Note: See TracChangeset
for help on using the changeset viewer.