W3C home > Mailing lists > Public > www-svg@w3.org > March 2011

Re: Question about new DOM

From: Jeff Schiller <codedread@gmail.com>
Date: Sat, 5 Mar 2011 01:07:36 -0800
Message-ID: <AANLkTimucV=y-xdExzcX95-gpULVj_AMLYJcixRw2JvA@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: Cameron McCormack <cam@mcc.id.au>, www-svg <www-svg@w3.org>, annevk@opera.com
Right, the way I understood it was that HTML5 _did_ define how
innerHTML would work in an XML context and that the only thing holding
it back was for it to be defined in the SVG DOM and implemented by
browsers ... and not necessarily in that order :P

There's been some back and forth about what the property should be
called on SVG elements.

Personally I think 'innerHTML' is confusing for authors using SVG.

    myG.innerHTML = '<p .../>'; // wait, why can't I do this, <p> is
an HTML element!
    myG.innerHTML = '<circle id="foo".../>'; // wait, <circle> is not
an HTML element?
    myDiv.innerHTML = '<svg ... />'; // wait, my inner HTML is a SVG element?!?

My own pipe dream on this is that an 'inner' property could be
introduce in DOM Core for Element that works like innerHTML does (in
both HTML and XML contexts).  This also has the benefit of shortening
the JS required by four characters :)

Yes, I realize that convincing all browsers to choose to do this is a
near insurmountable task and could not be reliably relied on by
authors for years.  Hey, I did say it was a pipe dream. :-/

Jeff

On Fri, Mar 4, 2011 at 3:25 PM, Ian Hickson <ian@hixie.ch> wrote:
> On Sat, 5 Mar 2011, Cameron McCormack wrote:
>>
>> Cameron McCormack:
>> > I think it wouldn’t be so unreasonable to have an innerXML …
>>
>> Anne points out:
>>
>>   http://html5.org/specs/dom-parsing.html
>>
>> which defines innerHTML to do XML parsing/serialisation on all elements,
>> if the document is an XML document.
>
> For background, this has been in HTML for a while:
>
>  http://www.whatwg.org/specs/web-apps/current-work/complete.html#innerhtml
>
> I'll be updating HTML relatively soon to just defer to Anne's draft.
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 5 March 2011 09:08:28 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT