Polyglot Guidance for HTML5 Foreign Content Exceptions

The "in foreign content" insertion mode section of the HTML5 spec has some additional exceptions we should probably account for in the polyglot spec (http://dev.w3.org/html5/spec/Overview.html#parsing-main-inforeign).

Specifically:
1) The list of conditions causing a switch to secondary insertion mode (children of <foreignObject>, <desc>, etc.)
2) The list of elements forcing a foreign content section to close (<b>, <big>, etc.)

For (1), I suggest we state that the XHTML namespace must be explicitly declared on children of <foreignObject>, <desc>, etc. unless the child is a <math> or <svg> element. This would require removing/rewording the statement in section 5 indicating that no elements other than <html>, <svg>, and <math> should have namespace declarations. The listed cases for MathML elements would need to be handled in the same manner unless the child element is <mglyph> or <malignmark>, in which case no additional namespace declaration is necessary. The condition for <svg> inside <annotation-xml> would not need to be mentioned as the polyglot spec already requires that all <svg> elements have an explicit SVG namespace declaration.

For (2), I suggest stating that elements such as <b>, <big>, etc. must only be used as children of HTML elements. The <font> element would be an exception so long as it does not have any of the attributes "color", "face", or "size".

-Tony

Received on Monday, 21 June 2010 18:41:44 UTC