Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scroll-animation.html start and current time subtests #230

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/proxy-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,6 @@ function tickAnimation(timelineTime) {
(timelineTimeMs - fromCssNumberish(details, this.startTime)) *
this.playbackRate);

// Conditionally reset the hold time so that the finished state can be
// properly recomputed.
if (playState == 'finished' && effectivePlaybackRate(details) != 0)
details.holdTime = null;
updateFinishedState(details, false, false);
}
}
Expand Down Expand Up @@ -746,6 +742,12 @@ function createProxyEffect(details) {

let totalDuration;

if (timing.duration === Infinity) {
throw TypeError(
"Effect duration cannot be Infinity when used with Scroll " +
"Timelines");
}

// Duration 'auto' case.
if (timing.duration === null || timing.duration === 'auto' || details.autoDurationEffect) {
if (details.timeline) {
Expand Down
4 changes: 3 additions & 1 deletion src/scroll-timeline-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ export function addAnimation(scrollTimeline, animation, tickAnimation) {
animation: animation,
tickAnimation: tickAnimation
});
updateInternal(scrollTimeline);
queueMicrotask(() => {
flackr marked this conversation as resolved.
Show resolved Hide resolved
updateInternal(scrollTimeline);
});
}

// TODO: this is a private function used for unit testing add function
Expand Down
6 changes: 3 additions & 3 deletions test/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ PASS /scroll-animations/scroll-timelines/scroll-animation-inactive-timeline.html
PASS /scroll-animations/scroll-timelines/scroll-animation-inactive-timeline.html Animation start and current times are correct if scroll timeline is activated after animation.play call.
PASS /scroll-animations/scroll-timelines/scroll-animation-inactive-timeline.html Animation start and current times are correct if scroll timeline is activated after setting start time.
PASS /scroll-animations/scroll-timelines/scroll-animation-inactive-timeline.html Animation current time is correct when the timeline becomes newly inactive and then active again.
FAIL /scroll-animations/scroll-timelines/scroll-animation.html Animation start and current times are correct for each animation state.
FAIL /scroll-animations/scroll-timelines/scroll-animation.html Animation start and current times are correct for each animation state when the animation starts playing with advanced scroller.
PASS /scroll-animations/scroll-timelines/scroll-animation.html Animation start and current times are correct for each animation state.
PASS /scroll-animations/scroll-timelines/scroll-animation.html Animation start and current times are correct for each animation state when the animation starts playing with advanced scroller.
PASS /scroll-animations/scroll-timelines/scroll-animation.html Finished animation plays on reverse scrolling.
FAIL /scroll-animations/scroll-timelines/scroll-animation.html Sending animation finished events by finished animation on reverse scrolling.
PASS /scroll-animations/scroll-timelines/scroll-timeline-invalidation.html Animation current time and effect local time are updated after scroller content size changes.
Expand Down Expand Up @@ -960,7 +960,7 @@ PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting an unre
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting an unresolved start time sets the hold time to unresolved when the timeline is inactive
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting the start time resolves a pending ready promise
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting the start time resolves a pending ready promise when the timelineis inactive
FAIL /scroll-animations/scroll-timelines/setting-start-time.html Setting an unresolved start time on a play-pending animation makes it idle
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting an unresolved start time on a play-pending animation makes it idle
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting the start time updates the finished state
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting the start time on a running animation updates the play state
PASS /scroll-animations/scroll-timelines/setting-start-time.html Setting the start time on a reverse running animation updates the play state
Expand Down
Loading