tmpvar/jsdom — pull request #462 by aredridel (2012-06-25 01:42:02+00:00)
Title: (hackily) make sure that doctypes don't get set as the documentElement

This has been one of the causes of aredridel/html5#30, which I can now reproduce without Zombie.

It works fine if the HTML5 parser assembles the document from completely empty, but it explodes if jsdom has set up any of the structure.

This is just one possible implementation, though it works for me.