Skip to content

Commit

Permalink
HTML parser: make breaking out of foreign content apply in innerHTML
Browse files Browse the repository at this point in the history
This is intended to match Chromium and WebKit.

Fixes #5117.
  • Loading branch information
zcorpan committed Feb 19, 2021
1 parent 3a5c6c5 commit 1d271f2
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -111047,23 +111047,12 @@ document.body.appendChild(text);
<dd>
<p><span>Parse error</span>.</p>

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

<p>If the parser was created as part of the <span>HTML fragment parsing algorithm</span>, then
act as described in the "any other start tag" entry below. (<span>fragment case</span>)</p>

<p>Otherwise:</p>

<p>Pop an element from the <span>stack of open elements</span>, and then keep popping more
elements from the <span>stack of open elements</span> until the <span>current node</span> is a
<span>MathML text integration point</span>, an <span>HTML integration point</span>, or an
element in the <span>HTML namespace</span>.</p>

<p>Then, reprocess the token.</p>
<p>Process the token <span>using the rules for</span> the "<span data-x="insertion mode:
in body">in body</span>" <span>insertion mode</span>.</p>
</dd>

<dt>Any other start tag</dt>
Expand Down

0 comments on commit 1d271f2

Please sign in to comment.