Hello everybody, I'm composing an initial mail to the CSS specification mailing list in which I want to propose the introduction of an additonal TransitionEvent type ... for now I just call it 'transitionsend'. In contrast to the existing 'transitionend' event, my suggested one will be fired on an HTMLElement, once __all__ of its transitioned style properties have reached their final value.
Rationale --- Today, most JS libraries that offer CSS-based tweening/animation functionality implement this by interval- or requestAnimationFrame-tiggered (the latter not widely-spread yet) periodical function calls. One of the main reasons for using CSS3 Transitions is probably the better performance. Instead of executing a listener function hundred times or more for tweening an element style, the changes to style property values are calculated and applied by compiled lower-level code -- what leads to a far better overall performance. In order to synchronize transitions (what actually is a core feature of every common JS library) or trigger further actions depending on an element's transition state, a script programmer only has one way to accomplish those tasks: + keep track of all style properties that are transitioned + listen to 'transitionend' and update a list of remaining properties + if list is empty (=all transitions have finished), trigger further actions Due to this, the performance gain brought by CSS3 Transitions is almost completely re-consumed. So in the end, nothing (related to performance) has really changed. The 'transitionsend' event I want to propose, circumvents this trap by simply being fired once all transitioned style properties have finished. I need your feedback --- I guess that most readers of this mail are involved in the development of the style-system/CSSOM and thereby have deep insights into those parts of the code base that might be concerned by what I want to propose. So I ask you: + Are the assumptions I've made in my rationale correct (from and implementor's pov) ? + Given the sync use case above, in what magnitude would the performance gain be in? + What do you think about my suggestion? Your feedback is very important to me. Thanks in advance, Peter _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

