W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2013

Re: [whatwg] Parsing the string <html>

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 2 Aug 2013 23:04:58 +0000 (UTC)
To: "Mohammad Al Houssami (Alumni)" <mha53@mail.aub.edu>
Message-ID: <alpine.DEB.2.00.1308022259170.27623@ps20323.dreamhostps.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
On Fri, 2 Aug 2013, Mohammad Al Houssami (Alumni) wrote:
> 
> When parsing the string <html> the document should supposedly have an 
> html root with head and body children. ( This is what live dom viewer 
> shows at least) but according to the specs( if im not wrong) we only get 
> the document with the html element and the stack of open elements will 
> have html head and body elements in it.

The "<html>" start tag token causes you to jump from the "initial" 
insertion mode to the "before html" insertion mode, and then the <html> 
element is created and you jump to "before head".

You then hit the "end of file" token, and that causes the <head> element 
to be generated, and switches you to "in head", where <head> is popped and 
you switch to "after head", where you insert a <body> element and switch 
to "in body", at which point you stop parsing.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 2 August 2013 23:05:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:23 UTC