W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

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

From: Michael Day <mikeday@yeslogic.com>
Date: Tue, 02 Jul 2013 17:04:51 +1000
Message-ID: <51D27B93.6090508@yeslogic.com>
To: Ian Hickson <ian@hixie.ch>
Cc: whatwg@whatwg.org, Adam Barth <w3c@adambarth.com>
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
Received on Tuesday, 2 July 2013 07:05:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC