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

[whatwg] HTML tree construction, inserting a foreign element, and foster parenting

From: Nolan Waite <nolan@nolanw.ca>
Date: Sat, 20 Jul 2013 21:23:20 -0300
Message-Id: <DB51E3B5-32F8-4865-812F-E4667B091D69@nolanw.ca>
To: whatwg@lists.whatwg.org
Hello! I've a question about the HTML spec. Suppose I'm parsing the following markup:

<table><math>

My question is: when I insert an element for the start tag token named "math", is it affected by the foster parenting logic?

To explain further, I get confused during tree construction when I reach the start tag token named "math".

I'm told in http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#parsing-main-inbody to "insert a foreign element for the token". However, at http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#insert-a-foreign-element it's pointed out that "the insert a foreign element algorithm isn't affected by the foster parenting logic". It continues, apparently by way of explanation, that "the current node, when the insert a foreign element algorithm is invoked, is always itself a non-HTML element".

Except that, in this case, the current node is the HTML "table" element. So this note confuses me, even though I realize it's probably non-normative.

Which partial tree is correct here? Is it

body
    table
        math

or is it

body
    math
    table

(I asked this question on IRC, but I'm not really an IRC person and thought this a better venue.)
Received on Sunday, 21 July 2013 00:23:53 UTC

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