Re: PF-Wg feedback on CSS animations

On 26/04/2009, at 1:29 PM, Jonathan Snook wrote:

> On 24-Apr-09, at 4:03 PM, Dean Jackson wrote:
>> We didn't see as much need for a transitionStart event. Can you  
>> think of places where you need it because the functionality isn't  
>> available elsewhere? For example, if you are changing property  
>> values via JS you're already in a better place to set up the  
>> transition.
>
> While I don't have a particular use case at the moment, I could see  
> where you might have transitions defined on generic elements and  
> transitions being initiated via :hover. To determine  
> transitionStart, it'd be more cumbersome to have to do DOM traversal  
> and trap mouseover event handlers.
>
> For example, maybe I have a sidebar with links that have a  
> transition on them using something like:
>
> #sidebar a { /* define transition */ }
> #sidebar a:hover {  }
>
> Traversing the DOM, or even setting up event delegation at the top  
> level is cumbersome when a simple transitionStart would do the trick.

Sorry, I might be being dense, but why is the transition event any  
easier than a regular DOM event?

In your example above, eg. pseudocode

for (el in document.querySelectorAll("#sidebar a")) {
   el.addEventListener("mouseover"...)  // this should find  
your :hover cases
}

... or even do it on the top level, like you say.

I'm not against transitionStart events, I'd just like to be sure we're  
not adding something that's unnecessary unless there is a wide demand  
for it. It might just be that I haven't written enough content to come  
across a case where it's essential.

Dean

Received on Monday, 27 April 2009 08:24:22 UTC