Re: Fwd: Implementing HTMLDocument on all Documents (detailed review of the DOM)

* Simon Pieters wrote:
>I propose that some members of the HTMLDocument and HTMLElement interfaces  
>that are also useful for non-HTML documents and non-HTML elements are  
>moved either to Document and Element or to DocumentWithUsefulStuff and  
>ElementWithUsefulStuff interfaces (possibly with better names). If we go  
>with the latter option, DOM Core implementations would be able to either  
>not implement those interfaces or implement them on Document and Element  
>objects, probably using binding-specific methods.

I would then recommend to go with the DocumentWithUsefulStuff option and
keeping DOM Core's Document interface (and Element interface) useful for
all DOM implementations.

>HTML5 says that all Document objects must implement HTMLDocument and other  
>supported interfaces. I presume it says so in order to dodge the question  
>of when to implement which interface, in addition to making e.g.  
>document.cookie usable in SVG documents.

Yes, but also documents with elements from multiple namespaces, like an
SVG document inside a XHTML document, are a concern here. The individual
ExampleDocument interfaces are difficult to access in that scenario, and
you have to adapt scripts if you change the structure of the document. A
different approach like the one you propose would have to provide an
answer to these problems.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Tuesday, 21 August 2007 20:30:35 UTC