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

Re: Super rough draft of Window spec

From: liorean <liorean@gmail.com>
Date: Tue, 21 Feb 2006 15:10:52 +0100
Message-ID: <cee13aa30602210610h59ab350al@mail.gmail.com>
To: "Maciej Stachowiak" <mjs@apple.com>, public-webapi@w3.org

A few comments on this.

2.1:
Regarding the comment on DocumentView, isn't that DocumentView
actually just the DOM2 Views extensions of Document. We have
DocumentStyle, DocumentEvent, DocumentRange, DocumentTraversal etc.
interfaces from other DOM2 specs, all of them in reality extending the
DOM Core Document interface for user agents that support them.

Also, I don't think self is readonly in user agents except iew today.

3:
Similarly location can be set, and is treated as setting
location.href. Thus a setter is needed for it, on both document and
window interfaces.

5.
I believe that you can find the following syntax for setInterval/Timeout:
    setTimeout/Interval(
        [string functionBody | function timerFunction],
        [anything milliseconds],
        arg0,
        arg1
        ...,
        argn);
Where the actual handling if the first two arguments are not function
type and number type respectively is equivalent to the following:
    setTimeout/Interval(
        new Function(
            [string FunctionBody]),
        Number([anything milliseconds]));
....while no conversion is necessary if they are already function and
number types respectively. Also the values of arg0, arg1 ..., argn are
passed to the function at time of invokation.

A quick confirmation of this can be gotten by running this in the
location field:
     javascript:var i=0;setInterval(function(n){alert([n++,i++])},0x400,i);
If the user agent doesn't support the arguments passing only i will be
displayed in the array, never n. n will be passed the value of i at
the time of the call to the setTimeout/interval, so it will be 0 each
time and not incremented between calls.
--
David "liorean" Andersson
<uri:http://liorean.web-graphics.com/>
Received on Tuesday, 21 February 2006 14:36:55 GMT

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