Skip to content

Conversation

@stephenmcgruer
Copy link
Contributor

As per the web-idl spec, float should only be used if there is a specific
reason, as double much more closely matches the ECMAScript Number
type. In the case of AnimationEvent's 'elapsedTime' member there does
not appear to be such a reason.

Furthermore, switching to double allows the elapsedTime to reach higher
values without overflowing. A rough calculation (with some assumptions
and possible errors) suggests that this change will raise the celing
from ~4.5 hours to years.

…' to 'double'

As per the web-idl spec, float should only be used if there is a
specific reason, as double much more closely matches the ECMAScript
Number type. In the case of AnimationEvent there does not appear to be
such a reason.

Furthermore, switching to double allows the elapsedTime to reach higher
values without overflowing. A rough calculation (with some assumptions
and possible errors) suggests that this change will raise the celing
from ~4.5 hours to years.
@stephenmcgruer
Copy link
Contributor Author

@birtles for review

@birtles
Copy link
Contributor

birtles commented May 11, 2018

Looks good to me. I checked that this change doesn't break any changes in Firefox's test suite and it seems fine.

@birtles birtles merged commit 6087644 into w3c:master May 11, 2018
@birtles
Copy link
Contributor

birtles commented May 11, 2018

@stephenmcgruer Do you mind submitting a similar PR for transitions?

@stephenmcgruer stephenmcgruer deleted the animation_event_elapsed_time branch May 11, 2018 14:21
@stephenmcgruer
Copy link
Contributor Author

@birtles Sure; #2671

aarongable pushed a commit to chromium/chromium that referenced this pull request May 14, 2018
w3c/csswg-drafts#2666 and
w3c/csswg-drafts#2671 updated the spec so that
elapsedTime as a member of AnimationEvent and TransitionEvent is
specified as a double instead of a float. Remove the TODOs as our
implementation is now correct.

Change-Id: I1c7abf14765fdbd46e37b4f8c506fed574cecdd0
Reviewed-on: https://chromium-review.googlesource.com/1056787
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Chris Nardi <cnardi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558285}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants