[whatwg] Another issue in 12.2.5.5 parsing tokens in foreign content

Hi,

Another issue regarding recent changes to 12.2.5.5 "The rules for 
parsing tokens in foreign content".

When a HTML start tag is seen (specifically "b", "big", "blockquote", 
"body", "br", "center", "code", ...) the following procedure is given to 
recover from the parse error:

"""
If the stack of open elements does not have an element in scope that is 
a MathML text integration point, an HTML integration point, or an 
element in the HTML namespace, or if the stack of open elements has only 
one element, then process the token using the rules for the "in body" 
insertion mode. (fragment case)
"""

Since the stack of open elements always has <html> at the top of the 
stack, the "element in scope" algorithm will always find it, and as a 
result, the first part of the condition will always fail.

This seems unintentional, and depends upon the exact way in which the 
"element in scope" algorithm is defined.

Perhaps rewriting this paragraph without reference to the "element in 
scope" algorithm would make the intent clearer? For example:

If the stack of open elements does not any elements that are MathML text 
integration points, or HTML integration points, or that are in the HTML 
namespace, or if the stack of open elements has only one element ...

Any thoughts?

Best regards,

Michael

Received on Thursday, 18 April 2013 07:27:57 UTC