Skip to content

Commit d04ee3d

Browse files
Stop reporting redundant fragment parser error in foreign content
I have tested this change against the test cases from html5lib-tests. In document parsing this doesn't change any test results. In fragment parsing this fixes 7 test cases by reporting one parser error less. (That is all existing HTML parsers that pass html5lib-tests must have already implemented these steps in the order they are changed to by this commit.) The test cases where one error is reported less fall in two categories: * fragment parsing e.g. `<svg></table>` with a `tbody` HTML element as the context element => one "unexpected end tag" error is reported less (previously it was reported twice) * fragment parsing e.g. `<g></path>` with a `path` SVG element as the context element => one "found special tag while closing generic tag" error is no longer reported Fixes html5lib/html5lib-tests#173.
1 parent c63f712 commit d04ee3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source

+5-5
Original file line numberDiff line numberDiff line change
@@ -126934,18 +126934,18 @@ document.body.appendChild(text);
126934126934
<li><p><i>Loop</i>: If <var>node</var> is the topmost element in the <span>stack of
126935126935
open elements</span>, then return. (<span>fragment case</span>)</p></li>
126936126936

126937+
<li><p>If <var>node</var> is an element in the <span>HTML namespace</span>,
126938+
process the token according to the rules given in the section corresponding
126939+
to the current <span>insertion mode</span> in HTML content.</p></li>
126940+
126937126941
<li><p>If <var>node</var>'s tag name, <span>converted to ASCII lowercase</span>, is
126938126942
the same as the tag name of the token, pop elements from the <span>stack of open
126939126943
elements</span> until <var>node</var> has been popped from the stack, and then return.</p></li>
126940126944

126941126945
<li><p>Set <var>node</var> to the previous entry in the <span>stack of open
126942126946
elements</span>.</p></li>
126943126947

126944-
<li><p>If <var>node</var> is not an element in the <span>HTML namespace</span>, return
126945-
to the step labeled <i>loop</i>.</p></li>
126946-
126947-
<li><p>Otherwise, process the token according to the rules given in the section corresponding
126948-
to the current <span>insertion mode</span> in HTML content.</li>
126948+
<li><p>Return to the step labeled <i>loop</i>.</p></li>
126949126949
</ol>
126950126950
</dd>
126951126951
</dl>

0 commit comments

Comments
 (0)