This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17301 - a "transitioncancel" event to listen for when a transition is removed before completion
Summary: a "transitioncancel" event to listen for when a transition is removed before ...
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: Transitions (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: public-css-bugzilla
URL: https://drafts.csswg.org/css-transiti...
Whiteboard: defer to level 2
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-03 19:08 UTC by fat
Modified: 2016-01-04 10:45 UTC (History)
6 users (show)

See Also:


Attachments

Description fat 2012-06-03 19:08:13 UTC
Currently the only event provided to JavaScript is the transitionend event.

From the spec:
In the case where a transition is removed before completion, such as if the transition-property is removed, then the event will not fire.

Because of the potential for events not to fire, when developing with transitionend events, you are often left with unfulfilled callbacks which are important to your application. 

Consider Twitter Bootstrap. We have a tooltip plugin which relies on the transitionend event to remove a tooltip from the dom. If a user aggressively mouses in and out of a tooltip target, eventually they will enter a state where the event is simply not fired, leaving zombie tooltips all over the screen.

Proposal:
We desperately need a reliable way to solve for this use case. I'm proposing a "transitioncancel" event to listen for when a transition is removed before completion.

Basically when i set up the expectation for a transition to happen in javascript, i need a way to know if my transition is not going to happen or if it has already taken place.
Comment 1 louisremi 2012-06-12 10:29:00 UTC
This is not only an implementation bug that happens with aggressive user interactions : there are different ways to stop transitions on an element that also prevent the transitionend event to fire :
- setting the inline style of an element to "transition: none"
- setting the inline style of an element to "transition-properties: none"
- setting the inline style of an element to "transition-duration: 0"
- setting an animated style property to its current computed value

In these different cases, the "transitioncancel" or "transitioncanceled" event would make sense.
Comment 2 L. David Baron (Mozilla) 2014-01-08 23:39:59 UTC
Agreed we should consider this, but at this point all new features go in Level 2 of the spec.