W3C home > Mailing lists > Public > public-webapi@w3.org > August 2007

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

From: Stewart Brodie <stewart.brodie@antplc.com>
Date: Tue, 21 Aug 2007 17:24:27 +0100
To: public-webapi@w3.org
Message-ID: <5e61eb32476914f750d5c34992399f0025792fa4@localhost>

"Simon Pieters" <simonp@opera.com> wrote:

> 
> On Tue, 21 Aug 2007 17:23:47 +0200, João Eiras <joao.eiras@gmail.com>  
> wrote:
> 
> >> Does this make sense on Element? I mean, the class attribute and it's
> >> semantics are HTML/XHTML specific.
> >
> >
> > The same goes for innerHTML. I agree there could be a generic property
> > to access the markup directly, but innerHTML's name is out of context.
> 
> innerHTML is actually not specific to HTML, despite its unfortunate name.
> 
> In an XML context, innerHTML, on getting, returns a serialized string of
> the node's children, in XML syntax. On setting it parses the assigned
> string as XML and replaces the node's children with the parsed XML.

>
http://www.whatwg.org/specs/web-apps/current-work/multipage/section-dynamic.html#innerhtml1


I assumed that what the document means is that if you have an XML document
and you have elements that are in the HTML namespace in that document, then
they should implement the HTMLElement interface, and thus have an innerHTML
property?   And nodes that are not in the HTML namespace do not have such a
property?

If the suggestion is really that XML documents with XML elements in them
have an innerHTML properties on all the elements, then that's just awful
abuse of the name.  It'd be better to add an innerContent property to
Element that does the right thing, before people start using it.

I'd be in favour of moving most of those other properties from HTMLDocument
to Document that were listed earlier in the thread, though - at least it
would fix the rather anomalous 'domain' property (which ends up being
read-only on HTMLDocument and write-only on Document - or was it vice versa?
It's certainly confusing)




-- 
Stewart Brodie
Software Engineer
ANT Software Limited
Received on Tuesday, 21 August 2007 16:24:19 GMT

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