W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: Proposal for mousewheel events

From: Sjoerd Visscher <sjoerd@w3future.com>
Date: Mon, 10 Apr 2006 22:26:50 +0200
Message-ID: <443ABF8A.2040306@w3future.com>
To: public-webapi@w3.org

Boris Zbarsky wrote:
> Sjoerd Visscher wrote:
>> I just checked and this is just like onmouseup and onclick, there is 
>> no redraw between those events in Firefox and IE.
> 
> It depends on what you do between them, actually.
> 
>> F.e. if you make the body background black in onmouseup, then start a 
>> calculation in onclick that takes a while, and at the end set the 
>> background back to white, you'll never see a black background.
> 
> On the other hand, if you start a synchronous XMLHttpRequest in 
> onmouseup after setting the background, what happens?  Does the browser 
> not draw at all until the XMLHttpRequest finishes?  (It's actually 
> possible that Gecko does that; but we're working on fixing those cases.)

No, a synchronous XMLHttpRequest does not block the running javascript 
thread. But it will therefore also not block the onclick handler, and 
you'll still see no black background flash. The onclick and onmouseup 
events run in the same thread. Only when this thread is done, you'll see 
a redraw. The onreadystate event will start a new thread to finish 
handling the XMLHttpRequest.

Firefox and IE do not redraw as long as the javascript code is running. 
So what I mean with forbidding a redraw is that the 2 events run in the 
same javascript thread.

-- 
Sjoerd Visscher
http://w3future.com/weblog/
Received on Monday, 10 April 2006 20:27:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT