Skip to content

Commit f690ad9

Browse files
zcorpandomenic
authored andcommitted
HTML parser: make breaking out of foreign content apply in innerHTML
This is intended to match Chromium and WebKit. Fixes #5117.
1 parent fade69e commit f690ad9

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

source

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111073,23 +111073,12 @@ document.body.appendChild(text);
111073111073
<dd>
111074111074
<p><span>Parse error</span>.</p>
111075111075

111076-
<!-- for sanity's sake, we limit this wacked quirk to legacy full-document parsing, not to
111077-
innerHTML. We have no data showing whether (or that) this is needed for innerHTML. If innerHTML
111078-
is used on an SVG or MathML node, it definitely doesn't make any sense (there's nothing to pop
111079-
to in the first place). Therefore, rather than trying to figure out in what convoluted
111080-
conditions we could actually do this quirk for innerHTML, we just don't do it at all. -->
111076+
<p>While the <span>current node</span> is not a <span>MathML text integration point</span>, an
111077+
<span>HTML integration point</span>, or an element in the <span>HTML namespace</span>, pop
111078+
elements from the <span>stack of open elements</span>.</p>
111081111079

111082-
<p>If the parser was created as part of the <span>HTML fragment parsing algorithm</span>, then
111083-
act as described in the "any other start tag" entry below. (<span>fragment case</span>)</p>
111084-
111085-
<p>Otherwise:</p>
111086-
111087-
<p>Pop an element from the <span>stack of open elements</span>, and then keep popping more
111088-
elements from the <span>stack of open elements</span> until the <span>current node</span> is a
111089-
<span>MathML text integration point</span>, an <span>HTML integration point</span>, or an
111090-
element in the <span>HTML namespace</span>.</p>
111091-
111092-
<p>Then, reprocess the token.</p>
111080+
<p>Process the token <span>using the rules for</span> the "<span data-x="insertion mode:
111081+
in body">in body</span>" <span>insertion mode</span>.</p>
111093111082
</dd>
111094111083

111095111084
<dt>Any other start tag</dt>

0 commit comments

Comments
 (0)