Closed Bug 1336899 Opened 7 years ago Closed 7 years ago

transitioncancel is fired after transition has already fired transitionend

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: birtles, Assigned: mantaroh)

Details

Attachments

(2 files)

Attached file Test case
According to CSS transitions, only running transitions are cancelled yet in the attached test we fire a transitioncancel event for a finished transition.

Admittedly, in CSS transitions level 2[1] this is less than clear where, "not idle or after → idle" should probably be written "not idle and not after → idle".

Basically this code fails to check for the after state:

  // Handle cancel events firts
  if (mPreviousTransitionPhase != TransitionPhase::Idle &&
      currentPhase == TransitionPhase::Idle) {
    TimeStamp activeTimeStamp = ElapsedTimeToTimeStamp(aActiveTime);
    events.AppendElement(TransitionEventParams{ eTransitionCancel,
                                                aActiveTime,
                                                activeTimeStamp });
  }

While we're at it can we should also fix the following nits:

1. s/firts/first/ in the comment above

2. One unnecessary space before = in:

  TimeStamp zeroTimeStamp   = AnimationTimeToTimeStamp(zeroDuration);
  TimeStamp startTimeStamp  = ElapsedTimeToTimeStamp(intervalStartTime);
  TimeStamp endTimeStamp    = ElapsedTimeToTimeStamp(intervalEndTime);

3. The following lines are not needed:

    intervalStartTime = zeroDuration;
    intervalEndTime   = zeroDuration;

[1] https://drafts.csswg.org/css-transitions-2/#event-dispatch
Marking this as P1 since we really shouldn't ship transitioncancel with this bug.
Priority: -- → P1
Comment on attachment 8833875 [details]
Bug 1336899 - Should not fire the transitioncancel after ending CSS Transition.

https://reviewboard.mozilla.org/r/109982/#review110986

Thanks!
Attachment #8833875 - Flags: review?(bbirtles) → review+
Pushed by mantaroh@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/1895e4ebd7e8
Should not fire the transitioncancel after ending CSS Transition. r=birtles
https://hg.mozilla.org/mozilla-central/rev/1895e4ebd7e8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: