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

Michael Day mikeday at yeslogic.com
Tue Jul 2 00:04:51 PDT 2013


Hi Ian,

> I ended up removing this from the spec for other reasons, so this should
> be resolved now. Let me know if it's not.
>
> (No, I don't know what I had originally intended.)

I don't think the new spec is correct. The question is what happens if 
we are tokenizing some foreign content, and we see an HTML start tag.

In the normal case, we pop off all the foreign elements until we get 
back to the HTML namespace, then reprocess the token.

In the fragment case, the context element may be a foreign element, so 
there was the wrinkle of having to handle that appropriately when we 
have this fake "root" <html> element that makes everything confusing.

The new text reads:

"If the parser was originally created for the HTML fragment parsing 
algorithm, then act as described in the "any other start tag" entry 
below. (fragment case)"

This always just adds the HTML element in place inside the foreign 
content, even if the fragment context element *is* a HTML element!

This can't be right, as it means parsing document.body.innerHTML will 
behave totally differently to parsing <html><body>, for no reason.

Looking back a couple of years, this section of the spec seems to be 
drifting in a random walk away from reality. We can study this further 
and try suggesting some text based on what we have implemented so far.

Best regards,

Michael

-- 
Prince: Print with CSS!
http://www.princexml.com



More information about the whatwg mailing list