Re: Some thoughts on DOM 2.0, Simpler

On 7/27/09 10:23 AM, Anne van Kesteren wrote:
> On Mon, 27 Jul 2009 10:17:39 +0200, Cameron McCormack <> 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?


Received on Monday, 27 July 2009 11:29:54 UTC