SVGWindow interface setInterval/setTimeout

Hi,

setInterval (applies to setTimeout too) is defined as

Object            setInterval ( in DOMString code, in long delay );

firstly you have an inconsistency with clearInterval where the type of the
parameter is "object", but that's a typo I guess, I assume you're using
object to refer to some implementation specific object, what it is is up
to the authors?

Current implementations are not as simple as the above,

setInterval("moo()",1000)
and
setInterval(moo,1000)

are both allowed, and do the same thing - so the first parameter is a
DOMString, the second a function reference, the latter a function
reference is more efficient, and also the only available in at least 1
mobile javascript implementation in the HTML world (the DOMString one
requires a compiler on the device AvantGo for the Palm compiles the script
on a server)

In a mixed script language world, which language is the DOMString assumed
to be?  IE's setTimeout implementation has a 3rd parameter "language"
(although not as mime-type unfortunately)

With the DOMString method, we cannot pass objects to functions being
called, i.e.:

moomin=SVGDoc.getElementsByTagName("rect").item(7)
setTimeout("changeColour(moomin)",1000)
or
setTimeout("changeColour("+moomin+")",1000)

don't do what we would want, and the workarounds are inefficient,
especially with internal rather than DOM objects.  A number of browsers in
the HTML world, including Netscape, allow:

setTimeout(changeColour,1000,moomin)

to do what we want, the same would be nice in SVG.

Jim.

Received on Sunday, 17 November 2002 09:07:18 UTC