in the head with scripting disabled (no text, only link, style, meta)
in the head, with scripting enabled (can include text (like whitespaces) but parsed elements must result in link,style,meta DOM only)
in the body with scripting disabled (text, but no other noscript)
in the body with scripting enabled (text, but no other noscript and script tags)
so basically
<html><noscript><link href="e.css"></noscript><title>hi</title><h1>ho</h1>
but:
<html><noscript> <link href="e.css"></noscript><title>hi</title><h1>ho</h1>
and closes the <head> just before the <h1> in a scripting enabled case.
this would explain the DOMParser.parseFromString() behaviour, as it's a scripting disabled case....
In Chrome Canary 55.0.2866.0 the noscript element contains a text node and a link element. This matches the spec as far as I can tell; whitespace is allowed in noscript in head.
in the head with scripting disabled (no text, only link, style, meta)
in the head, with scripting enabled (can include text (like whitespaces) but parsed elements must result in link,style,meta DOM only)
in the body with scripting disabled (text, but no other noscript)
in the body with scripting enabled (text, but no other noscript and script tags)
so basically
would be find, as the <head> would close just before the <h1> (in scripting enabled and disabled case)but:
would close the <head> in a scripting disabled case just before the <noscript>-tagand closes the <head> just before the <h1> in a scripting enabled case.
this would explain the DOMParser.parseFromString() behaviour, as it's a scripting disabled case....