Re: Simplifying element creation

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 UTC