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

Re: DOM Views confusion

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 22 Mar 2006 00:36:06 -0800
Message-Id: <2C5640B0-9C6A-4CA2-A5E9-077AD5E02991@apple.com>
Cc: public-webapi@w3.org
To: Cameron McCormack <cam@mcc.id.au>


On Mar 21, 2006, at 10:08 PM, Cameron McCormack wrote:

>
> Ian Hickson:
>> In typical desktop browsers, the defaultView attribute should  
>> point to an
>> object which is all of the following:
>>
>>    The ECMAScript global object
>>    An object implementing Window
>>    An object implementing AbstractView
>>    An object implementing ViewCSS
>
> If this is what is desired, perhaps Window (or some related spec)  
> should
> require this.
>
>> See the WHATWG spec (and the WebAPI Window spec, probably).  
>> ViewCSS is one
>> of the interfaces implemented by Window.
>
> Window doesn't seem to mention ViewCSS.

Requiring the Window to be the defaultView is supposed to imply this  
for CSS UAs, but think it would also be OK to add a conditional  
requirement to Window:

"In user agents that support the ViewCSS interface from DOM Level 2  
Style, Window objects MUST implement the ViewCSS interface."

Test case:

shouldBeTrue("!document.getOverrideStyle || window.getComputedStyle");

I think this is arguably redundant with DOM Level 2 Style though...

>> You'll have to provide "language-specific casting methods" to get  
>> from the
>> Window object to the ViewCSS object. Conceptually, they're the same.
>
> Ok, but at the moment I don't see anything that requires ViewCSS to be
> implemented on the same object as Window.

DOM Level 2 Views says:

"The expectation is that an instance of the ViewCSS interface can be  
obtained by using binding-specific casting methods on an instance of  
the AbstractView interface."

Granted this is a bit ambiguous, but I think "an instance" is  
supposed to mean "any instance", not "some unspecified instance".

The Window draft says:

"Each view of a Document presented in a browsing context must be  
represented by an object that implements the Window interface."

This is intended to require that any AbstractView instance for such a  
Document must also implement Window. Granted this could be more clear.


> Just that if you are not allowed to assume that Window and ViewCSS are
> both implemented on the same object, the default view, then it's
> impossible to implement both Window and ViewCSS usefully.

That is why you need to assume it is the case.

>> In practice there is rarely more than one. Opera is the only  
>> browser I
>> know that actually supports multiple views, and it only has one  
>> View (you
>> can't get to the computed styles in its aural view; indeed I'm not  
>> sure
>> it even implements the concept of multiple media correctly).
>
> Having only one view implemented is likely to be because there is no
> proper way to get access to any other views...

If anyone wanted to support good multiple view support, then yes, I  
think a way to enumerate the views would be required. The fact that  
event listeners go on the DOM make this hard though, it's pretty  
awkward to separate user interaction with the different views.

In any case, I'm not sure the Window spec is the right place to solve  
all the multi-view issues.

Regards,
Maciej
Received on Wednesday, 22 March 2006 08:36:46 GMT

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