Skip to content

Commit 6a77e6d

Browse files
Make <body> not optional if first child is noscript
The `noscript` element is allowed in `head` and therefore it will be inserted to the `head` element by the parser if the `<body>` tag is omitted and `<noscript>` is the first non-whitespace token after `</head>`. This changes the syntax requirements so that it's not allowed to omit the `<body>` tag in this case. Fixes #7737 Co-authored-by: Simon Pieters <[email protected]>
1 parent 823a14b commit 6a77e6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106808,10 +106808,10 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
106808106808
<p>A <code>body</code> element's <span data-x="syntax-start-tag">start tag</span> may be omitted
106809106809
if the element is empty, or if the first thing inside the <code>body</code> element is not
106810106810
<span>ASCII whitespace</span> or a <span data-x="syntax-comments">comment</span>, except if the
106811-
first thing inside the <code>body</code> element is a <code>meta</code>, <code>link</code>,
106812-
<code>script</code>, <code>style</code>, or <code>template</code> element. <!-- Note that even if
106813-
the </head> end tag is present, the parser makes <style> and <script> elements between </head> and
106814-
<body> end up in the <head> instead of implying the <body> --></p>
106811+
first thing inside the <code>body</code> element is a <code>meta</code>, <code>noscript</code>,
106812+
<code>link</code>, <code>script</code>, <code>style</code>, or <code>template</code> element.
106813+
<!-- Note that even if the </head> end tag is present, the parser makes <style> and <script>
106814+
elements between </head> and <body> end up in the <head> instead of implying the <body> --></p>
106815106815

106816106816
<!-- </body> -->
106817106817
<p>A <code>body</code> element's <span data-x="syntax-end-tag">end tag</span> may be omitted if the

0 commit comments

Comments
 (0)