Re: Window object, very rough cut of proposed content for first version of spec

On 2/14/06, Maciej Stachowiak <mjs@apple.com> wrote:
> Not sure what you mean by legacy UAs. It works in Safari, Firefox,
> and Opera. I haven't tested Internet Explorer yet. Here's my test case:

Ah, sorry, I thought you knew, IE doesn't support this and never has.

> window.setTimeout(timerFunc, 100, "it worked");

In IE that would attempt to execute timerFunc by a script engine
represented by the string "it worked".

Just checking it appears Batik doesn't support it either.

Given the comments elsewhere on optional parameters in the DOM being
unfriendly to some implementors I think it's good to just duck it as
you note.

> I'm happy to drop this feature if IE can't do it, so long as the spec
> doesn't forbid supporting extra arguments in this way.

The spec shouldn't IMO forbid much.

> > There's also the issue of string/function.  I think it would be nice
> > to deprecate it immediately in favour of a better approach.
>
> I don't think the use of functions needs to be deprecated. If they
> are good enough to use in addEventListener, then surely they are good
> enough for timers.

I think the inherent idea of a function is good, I was just meaning
deprecate the entire setTimeout in favour of a method without the all
this legacy baggage that setTimeout has.

> IE also lets you specify a language for the string version (as in the
> whatwg draft), but the allowed values are only JScript, VBScript and
> JavaScript, so I am not sure this would be applicable to any other UA.

The allowed values are any string that a script handler exists in the
registry, the same as execScript.

> > Is it really right to specify this as a long?  wouldn't a
> > timerReference be better?
>
> Timer IDs are integer values in existing UAs. I agree a Timer object
> would be more elegant but it would not be compatible.

Sure it would, you don't need to specify anything beyond it's a timer
object, I don't see it as necessary to force this to be a long that is
all - there's nothing you can do with the returned ID other than pass
it to clearTimeout why limit it in any way?

> Cross-language script execution would be better specified as a
> separate feature instead of overloaded onto timers IMO.

Indeed!

Cheers,

Jim.

Received on Tuesday, 14 February 2006 11:29:56 UTC