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 23:47:46 +0200
Message-ID: <443AD282.5000006@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.)

Let me try this again. (I got synchronous and asynchronous confused, 
because synchronous sounds to me like things at the same time, while in 
this case it means coordinated time.)

So, an *asynchronous* 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.

But a *synchronous* call does block the running javascript thread, and 
no redraws happen in between. I don't think you can simply "fix" this, 
because you'll break the single-threadedness of javascript.

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
Received on Monday, 10 April 2006 21:48:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:21 UTC