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

Re: [whatwg] Parsing the string <html>

From: Mohammad Al Houssami (Alumni) <mha53@mail.aub.edu>
Date: Sat, 3 Aug 2013 00:08:48 +0000
To: Ian Hickson <ian@hixie.ch>
Message-ID: <0F8BA5A0576A5F44B0D188C2628265DA4070B069@AMSPRD0611MB548.eurprd06.prod.outlook.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
That is totally correct. But are the head and body elements added to the document? So basically when we stop parsing the document should only have the html element is that correct? 

-----Original Message-----
From: Ian Hickson [mailto:ian@hixie.ch] 
Sent: Saturday, August 03, 2013 12:05 AM
To: Mohammad Al Houssami (Alumni)
Cc: whatwg@whatwg.org
Subject: Re: [whatwg] Parsing the string <html>

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 Saturday, 3 August 2013 00:09:19 UTC

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