W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] main element parsing behaviour

From: Jirka Kosek <jirka@kosek.cz>
Date: Wed, 07 Nov 2012 13:25:14 +0100
Message-ID: <509A532A.2090204@kosek.cz>
To: Simon Pieters <simonp@opera.com>
Cc: whatwg <whatwg@whatwg.org>, Steve Faulkner <faulkner.steve@gmail.com>
On 7.11.2012 13:13, Simon Pieters wrote:

> If we were to design a system where we can make up new elements that go
> in one of those categories without changing the parser, I think we
> effectively have to put a magic string in the tag name, e.g. any element
> that starts with "block" is treated like <address>, but that has
> disadvantages:
> 
> * Looking at a substring of the tag name complicates the parser and
> probably ruins some optimizations.
> * It means new non-inline elements will have long, ugly two-word names
> which is inconsistent with the rest of the language.

Indeed, this doesn't seem very appealing.

> I can imagine other designs as well but they don't seem any better.
> 
> In conclusion, I think changing the parser when we introduce a new
> "block" or "void" element is a better approach.

I think it's better to treat all new elements as inline (from parsing
point of view) then to change algorithm each time.

Changing parsing each time also means that such changes can't be undone.
Look for example at <hgroup>. It's supported by parsing algorithm as
implemented in browsers, so it will remain in spec forever even when
it's not actually implemented. With such approach parsing algorithm will
became boneyard of proposed but later thrown away elements over the time.

				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------
Received on Wednesday, 7 November 2012 12:25:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT