You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A start tag whose tag name is one of: "b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"
A start tag whose tag name is "font", if the token has any attributes named "color", "face", or "size"
An end tag whose tag name is "br", "p"
Parse error\.
While the current node is not a MathML text integration point, an HTML integration point, or an element in the HTML namespace, pop elements from the stack of open elements\.
Process the token using the rules for the "in body" insertion mode\.
I think that processing the token using the rules for "in body" isn't correct here. Consider the following HTML.
<!DOCTYPE html><body><table><svg><p>X</table>
My understanding of the spec is that the <svg> tag should cause the svg element to be foster parented before the table element from the anything else rule in the in table insertion mode. The <p> tag is processed according to the rule quoted above. That's going to pop the svg element off the stack of open elements which then consists of html > body > table.
At this point, I think the following should happen:
the <p> tag is processed according to the in table insertion mode which foster parents the p element before the table;
the X is processed according to the in table insertion mode which foster parents the text node but since the target is the p element, foster parenting does nothing; and
the </table> tag closes the table element.
This would result in the following DOM.
<!DOCTYPE html>
<html>
<head>
<body>
<svg:svg>
<p>
"X"
<table>
Firefox, Chrome, and Safari agree with this interpretation.
However, the following is what I think the spec says happens:
the <p> tag is processed according to the in body insertion mode which inserts a p element as a child of the table;
the X is processed according to the in table insertion mode (because nothing has changed the tree construction's insertion mode) which foster parents the text node but places it in the p element as normal; and
the </table> tag closes the table element.
This results in the following DOM.
<!DOCTYPE html>
<html>
<head>
<body>
<svg:svg>
<table>
<p>
"X"
Maybe all that needs to happen is after popping the stack of open elements until the current node is a MathML text integration point, HTML integration point, or an HTML element, the token should be processed using the rules for the current insertion mode in HTML content, similar to the last step of the any other end tag in foreign content.
The text was updated successfully, but these errors were encountered:
Update to the latest version of html5lib-tests. The spec currently has a
[bug](whatwg/html#6808) so the parser does not
conform to the spec, but it does match Safari, Firefox, Chrome, and the
html5lib-tests tests.
https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
I think that processing the token using the rules for "in body" isn't correct here. Consider the following HTML.
My understanding of the spec is that the
<svg>
tag should cause thesvg
element to be foster parented before thetable
element from the anything else rule in the in table insertion mode. The<p>
tag is processed according to the rule quoted above. That's going to pop thesvg
element off the stack of open elements which then consists ofhtml > body > table
.At this point, I think the following should happen:
<p>
tag is processed according to the in table insertion mode which foster parents thep
element before the table;X
is processed according to the in table insertion mode which foster parents the text node but since the target is thep
element, foster parenting does nothing; and</table>
tag closes thetable
element.This would result in the following DOM.
Firefox, Chrome, and Safari agree with this interpretation.
However, the following is what I think the spec says happens:
<p>
tag is processed according to the in body insertion mode which inserts ap
element as a child of thetable
;X
is processed according to the in table insertion mode (because nothing has changed the tree construction's insertion mode) which foster parents the text node but places it in thep
element as normal; and</table>
tag closes thetable
element.This results in the following DOM.
Maybe all that needs to happen is after popping the stack of open elements until the current node is a MathML text integration point, HTML integration point, or an HTML element, the token should be processed using the rules for the current insertion mode in HTML content, similar to the last step of the any other end tag in foreign content.
The text was updated successfully, but these errors were encountered: