W3C home > Mailing lists > Public > www-svg@w3.org > July 2009

Re: Some thoughts on DOM 2.0, Simpler

From: Jonathan Watt <jwatt@jwatt.org>
Date: Mon, 27 Jul 2009 13:29:15 +0200
Message-ID: <4A6D8F8B.2070902@jwatt.org>
To: Anne van Kesteren <annevk@opera.com>
Cc: Cameron McCormack <cam@mcc.id.au>, Jeff Schiller <codedread@gmail.com>, www-svg <www-svg@w3.org>
On 7/27/09 10:23 AM, Anne van Kesteren wrote:
> On Mon, 27 Jul 2009 10:17:39 +0200, Cameron McCormack <cam@mcc.id.au> wrote:
>> Anne van Kesteren:
>>> Per HTML5 there is no difference between the two. innerHTML on
>>> elements however only applies to elements in the HTML namespace.
>> Ah, of course; innerHTML is on HTMLElement.
>>
>> I wonder if there would be any downsides to moving innerHTML to Element
>> (apart from the misleading name).
> 
> I would not be opposed (and cannot really think of a downside). The name is indeed somewhat unfortunate, but we're pretty much stuck with it.

Why are we "stuck with it"? If a new property is added to the Element interface,
what's the great problem with naming it "innerMarkup" or perhaps (for symmetry
with textContent) "markupContent"?

As an author I'd want the new content to be parsed with the default namespace
set to the namespace of the element to which I'm assigning new content. Calling
it innerHTML is then confusing/misleading for me, since it makes it sounds like
the markup should be HTML, or else namespaces need to be used in the markup
string. Yet another bump in learning the language.

It seems to me calling it innerHTML detracts from the author experience of the
language, and for what? So that implementers don't have the burden of writing a
couple of lines of code mapping the new property to their implementation of
innerHTML? Or perhaps it's too much to have the spec say something akin to
"markupContent maps to innerHTML". Isn't author burden supposed to be put before
implementer and spec writer burden?

Jonathan
Received on Monday, 27 July 2009 11:29:54 GMT

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