W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: Simplifying element creation

From: Roland Steiner <rolandsteiner@google.com>
Date: Wed, 5 Oct 2011 08:28:36 +0900
Message-ID: <CACFPSpjVD1vmdrRfG+RTyBtf66nj8DibkGpBQ_k-fWjiBjgsEQ@mail.gmail.com>
To: Dominic Cooney <dominicc@chromium.org>
Cc: Anne van Kesteren <annevk@opera.com>, "www-dom@w3.org" <www-dom@w3.org>
On Tue, Oct 4, 2011 at 6:18 PM, Dominic Cooney <dominicc@chromium.org>wrote:

> On Tue, Oct 4, 2011 at 5:30 PM, Anne van Kesteren <annevk@opera.com>
> wrote:
> > E.g. <div>Hello <a href="/">World</a></div> is represented as:
> >
> >  ["div", "Hello ", ["a", {href:"/"}, "World"]]
>
> I think readability suffers a bit because element names and text are
> both strings.
>

It also invites errors, e.g., ["style", "scoped"] (missing curly brackets)

But I think it's worse than just readability:

.) you cannot have text nodes that contain a string that could be an element
name, e.g., ["dl", ["dt", "object"], ["dd', "the base class of the type
hierarchy"]].
.) later on you cannot introduce new HTML elements, because someone might
have used that element's name as a text string with the above syntax.


Cheers,

- Roland
Received on Tuesday, 4 October 2011 23:29:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT