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

Re: Super rough draft of Window spec

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 21 Feb 2006 17:27:07 -0800
Message-Id: <1DFA9CB6-1C31-4F6A-B352-9ED3EA08B465@apple.com>
Cc: public-webapi@w3.org
To: liorean <liorean@gmail.com>


Hi,

Thanks for the quick feedback! This is one of the great things about  
working in the open.

On Feb 21, 2006, at 6:10 AM, liorean wrote:

> 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.

Yes, I realize this is the intent and the usual practice. But I don't  
think the specs are very clear about what the conformance  
requirements are. I think the Window spec should make very clear that  
the

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

I did some cursory tests, and it appears to be read-only in Safari  
2.0.3 and Mac IE 5.2 but not Firefox 1.5.

We plan to do extensive testing of all methods and properties in  
existing browsers before finalizing the spec. If you would like to  
help make test cases, that would be great.

> 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.

This is noted in the IDL comments. However, assignment of "location"  
is somewhat weird. It can be assigned a string or anything  
convertible to a string; it's not really truly assignable from other  
location objects. Assigning another "location" assigns it as a  
string, which effectively makes a copy rather than sharing object  
identity.

I think this is best represented as a quirk of the ECMAScript  
bindings, rather than represented in the IDL. Other languages don't  
necessarily need the same feature, since they can use  
window.location.assign().

> 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.

I had this in the original IDL I sent out as a comment. However, it  
turns out that IE does not support the extra args. IE also has an  
alternate syntax that allows you to specify the language to use to  
interpret the script, if a string is provided. I think both of these  
should be OPTIONAL level features, and only part of the ECMAScript  
bindings, not a general requirement in the IDL.

>
> 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.

Thanks, that is a good test case. I think you will find Win IE does  
not support this extension to the SetInterval syntax.

Thank you for your comments.

Regards,
Maciej
Received on Wednesday, 22 February 2006 01:27:12 GMT

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