strange threading in CSS animation events

71 views
Skip to first unread message

pat...@res3d.com

unread,
Jan 15, 2012, 3:22:46 PM1/15/12
to google-chrome-...@googlegroups.com
Chrome appears to be executing my custom event handler while I'm
stepping over my code, which confuses me as I understood there to be
only one javascript thread per tab. Consider this:

           function animationEnd() {
               console.log('animationEnd')
           }

           debugger
           $('#something').bind('webkitAnimationEnd', animationEnd)
           $('#something').addClass('animated')

=============================

#something.animated {
   -webkit-animation-name: myanimation;
}


The interpreter breaks at the 'debugger' statement, and then as I step
over the 'addClass' line 'animationEnd()' is called before I click
'continue'. How is this possible if there is only one javascript
thread?

Thanks!

Yury Semikhatsky

unread,
Jan 16, 2012, 7:49:44 AM1/16/12
to google-chrome-...@googlegroups.com
You are right there is only one javascript thread in the render process. When
JS execution is paused we still need to process incoming commands to make
inspected page's UI responsive and to process DevTools' commands like
e.g. 'step over'. To make sure no JS is executed in the page while it is
paused we suspend all possible JS entry points including DOM event listeners
and timers. It looks as if CSS3 animation wasn't handled properly. I filed a bug
You can add yourself to the CC list to track its progress.

Thanks,
Yury
Reply all
Reply to author
Forward
0 new messages