Closed Bug 1166164 Opened 10 years ago Closed 10 years ago

Update the finishing behavior of Animation objects

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: birtles, Assigned: birtles)

References

Details

Attachments

(8 files, 1 obsolete file)

39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
39 bytes, text/x-review-board-request
jwatt
: review+
smaug
: review+
Details
We recently resolved[1] to fix a number of inconsistencies in the way finishing behavior works for Animation objects. In attempting to implement these changes I've discovered some other existing issues with the spec and our implementation. [1] https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0038.html
/r/8999 - Bug 1166164 part 1 - Make setting the current time complete a pending pause, not abort it /r/9001 - Bug 1166164 part 2 - Make UpdateFinishedState take a non-defaulted enum /r/9003 - Bug 1166164 part 3 - Resolve start time on finish() /r/9005 - Bug 1166164 part 4 - Make finished promise not resolve when paused /r/9007 - Bug 1166164 part 5 - Make play() throw when it should seek to the end of an infinite effect /r/9009 - Bug 1166164 part 6 - Make pausing from idle set the current time /r/9011 - Bug 1166164 part 7 - Call pause directly when creating an initially-paused animation /r/9013 - Bug 1166164 part 8 - Drop a few references to players Pull down these commits: hg pull -r fadb9581d971d6693e59187f5474a4d6b36651a3 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8607373 - Flags: review?(jwatt)
Attachment #8607373 - Flags: review?(bugs)
Could you explain why play() and pause() need [Throws]? That is not in the spec, nor in that email to the mailing list.
https://reviewboard.mozilla.org/r/9001/#review7673 ::: dom/animation/Animation.h:303 (Diff revision 1) > + enum class SeekBehavior { > + NoSeek, > + DidSeek To better match the spec text I'd suggest calling the enum "SeekFlag" and the values "Seek" and "NoSeek". ::: dom/animation/Animation.cpp:92 (Diff revision 1) > - UpdateTiming(); > + UpdateTiming(SeekBehavior::NoSeek); It would be useful to have a comment here explaining why this is not a seek, since initially one might think it effectively is.
https://reviewboard.mozilla.org/r/9005/#review7703 ::: dom/animation/Animation.cpp (Diff revision 1) > -Animation::IsFinished() const Yay!
(In reply to Olli Pettay [:smaug] from comment #2) > Could you explain why play() and pause() need [Throws]? > That is not in the spec, nor in that email to the mailing list. Looks like part of the spec is out of date. The exception is mentioned in the prose that describes the algorithm for play() and pause() though. See the mention of InvalidStateError in these sections: http://w3c.github.io/web-animations/#play-an-animation http://w3c.github.io/web-animations/#pause-an-animation
Comment on attachment 8607373 [details] MozReview Request: bz://1166164/birtles r+ for the webidl (I assume that is what the request was about.)
Attachment #8607373 - Flags: review?(bugs) → review+
https://reviewboard.mozilla.org/r/9009/#review7715 Ship It! ::: layout/style/nsAnimationManager.cpp:104 (Diff revision 1) > + NS_WARNING("Unexpected exception pausing animation"); Can you expand on this message by tacking on " - silently failing" or something?
Attachment #8607373 - Flags: review?(jwatt) → review+
Comment on attachment 8607373 [details] MozReview Request: bz://1166164/birtles https://reviewboard.mozilla.org/r/8997/#review7721 Ship It!
(In reply to Jonathan Watt [:jwatt] from comment #5) > (In reply to Olli Pettay [:smaug] from comment #2) > > Could you explain why play() and pause() need [Throws]? > > That is not in the spec, nor in that email to the mailing list. > > Looks like part of the spec is out of date. The exception is mentioned in > the prose that describes the algorithm for play() and pause() though. See > the mention of InvalidStateError in these sections: > > http://w3c.github.io/web-animations/#play-an-animation > http://w3c.github.io/web-animations/#pause-an-animation Which part of the spec is out of date? It's mentioned in those two sections Jonathan pointed too. Where else does it need to be mentioned? As far as I can tell, WebIDL doesn't have [Throws] extended attributes anymore, that's specific to our bindings.
(In reply to Olli Pettay [:smaug] from comment #11) > Comment on attachment 8607373 [details] > MozReview Request: bz://1166164/birtles > > r+ for the webidl (I assume that is what the request was about.) Yes, sorry, I haven't worked out how to indicate that in reviewboard yet.
(In reply to Brian Birtles (:birtles) from comment #17) > > Yes, sorry, I haven't worked out how to indicate that in reviewboard yet. me neither. I end up downloading the diffs and looking at them in an editor because that is how I like to see the patches. (I don't like the diff-view) :)
(In reply to Jonathan Watt [:jwatt] from comment #3) > https://reviewboard.mozilla.org/r/9001/#review7673 > > ::: dom/animation/Animation.h:303 > (Diff revision 1) > > + enum class SeekBehavior { > > + NoSeek, > > + DidSeek > > To better match the spec text I'd suggest calling the enum "SeekFlag" and > the values "Seek" and "NoSeek". I renamed the enum to SeekFlag as suggested but I left the values as NoSeek and DidSeek since the spec refers to the "did seek" flag and it's only set when a seek happened in the past. I'm happy to push a follow-up patch to change this if you still think it's odd. > ::: dom/animation/Animation.cpp:92 > (Diff revision 1) > > - UpdateTiming(); > > + UpdateTiming(SeekBehavior::NoSeek); > > It would be useful to have a comment here explaining why this is not a seek, > since initially one might think it effectively is. Sorry, I overlooked this comment. (Reviewboard makes it really hard to find the bit of code a comment is associated with but I believe this is referring to SetStartTime.) I'm not sure exactly what's surprising here; I guess setting the start time feels like seeking?
(In reply to Brian Birtles (:birtles) from comment #20) > I renamed the enum to SeekFlag as suggested but I left the values as NoSeek > and DidSeek since the spec refers to the "did seek" flag and it's only set > when a seek happened in the past. I'm happy to push a follow-up patch to > change this if you still think it's odd. That's fine. On a bit more reflection it's the "NoSeek" I have a bit of an issue with since it sounds imperative rather than informative about something that has already happened. Not a big deal though, and I don't have a suggestion other than DidNotSeek or something. Up to you whether you agree enough to write a follow-up. > Sorry, I overlooked this comment. (Reviewboard makes it really hard to find > the bit of code a comment is associated with but I believe this is referring > to SetStartTime.) I'm not sure exactly what's surprising here; I guess > setting the start time feels like seeking? Yeah, Reviewboard is a bit annoying in that regard.
Attachment #8607373 - Attachment is obsolete: true
Attachment #8620322 - Flags: review+
Attachment #8620323 - Flags: review+
Attachment #8620324 - Flags: review+
Attachment #8620325 - Flags: review+
Attachment #8620326 - Flags: review+
Attachment #8620327 - Flags: review+
Attachment #8620328 - Flags: review+
Attachment #8620329 - Flags: review+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: