Everone clamps timers now. Chrome launched without a clamp, but even
without the clamp setTimeout(..., 0) enqueued an event onto the
message loop. There were some old mozilla browsers that didn't yield
on setTimeout of 0, but you would probably have to look pretty deep in
the archives to find one. Unless things have changed since the last
time I looked into this, this is the roll call on timer clamping:

Chrome: 4ms (fairly recent change)
Safari (mac): 10ms
Safari (win): 15ms
Firefox: 15ms (or 10ms if flash is running)
IE: 15ms
Opera: I have no clue.

So, that's just a really long way of saying that there is no danger in
allowing 0 and technically it is a perfectly legal value ... it's just
not very useful.

/kel

On Mon, Dec 8, 2008 at 11:45 PM, Bruce Johnson <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 8, 2008 at 8:34 PM, Ray Cromwell <[EMAIL PROTECTED]> wrote:
>>
>> I've always assumed that 0 wasn't portable and use 10 by convention.
>> Ideally, you'd want 0 to function like yield(), but I had a nagging
>> suspicious that some browsers might treat 0 as a NOP (that is, run the
>> code immediately without yielding)
>
> Even so, the API method itself should accept 0, I think, and we could just
> round it up to the lowest number acceptable to the browser, such as "time =
> time <=0 ? 10 : time" or something like that.



-- 
If you received this communication by mistake, you are entitled to one
free ice cream cone on me. Simply print out this email including all
relevant SMTP headers and present them at my desk to claim your creamy
treat. We'll have a laugh at my emailing incompetence, and play a game
of ping pong. (offer may not be valid in all States).

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to