[whatwg] main element parsing behaviour

Jirka Kosek jirka at kosek.cz
Wed Nov 7 04:25:14 PST 2012


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 at 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
------------------------------------------------------------------



More information about the whatwg mailing list