This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Section: http://www.whatwg.org/specs/web-apps/current-work/#foster-parenting Comment: When is it ever possible for the last table element to have a parent who is not an element? Posted from: 128.12.145.60
I don't believe such would be possible since <html> is always the bottom of the stack, and the only non-element ContainerNodes are Document and DocumentFrament? Also, the sentence before: " If there is no table element in the stack of open elements (fragment case), then the foster parent element is the first element in the stack of open elements (the html element)" I don't see why that's the fragment case has an "html" element, but maybe I've not read enough of the fragment case parts of the spec yet.
Furthermore, this part of that paragraph is ambiguous: If the foster parent element is the parent element of the last table element in the stack of open elements, then node must be inserted immediately before the last table element in the stack of open elements in the foster parent element... Two readings: 1. node must be inserted immediately before the-last-table-element-in-the-stack-of-open-elements. and 2. node must be inserted in the stack of open elements, immediately before the-last-table-element. I'm assuming you meant reading #1.
An easy way to clarify the bug in comment #2 is to say "inserted into the dom" instead of "inserted"
Retitling the bug, since the whole foster parenting paragraph is confusing, per the 3 different issues pointed out above.
(In reply to comment #0) > When is it ever possible for the last table element to have a parent who is > not an element? <table> <script> var t = document.getElementsByTagName('table'); var f = document.createDocumentFragment(); f.appendChild(t); </script> X (In reply to comment #1) > Also, the sentence before: (I assume you mean after.) > "If there is no table element in the stack of open > elements (fragment case), then the foster parent element is the first element > in the stack of open elements (the html element)" > > I don't see why that's the fragment case has an "html" element, but maybe I've > not read enough of the fragment case parts of the spec yet. I'm not sure I follow what you're saying, but yes, in the fragment case (e.g. setting innerHTML on a <table>) the stack of open elements will just have a single <html> element at the top, and no <table>. Not sure how to clarify this further; it's assumed throughout the parser that that is a given, so clarifying it just here would be a bit weird. (In reply to comment #2) > Furthermore, this part of that paragraph is ambiguous: > > If the foster parent element is the parent element of the last table element in > the stack of open elements, then node must be inserted immediately before the > last table element in the stack of open elements in the foster parent > element... > > Two readings: > > 1. node must be inserted immediately before > the-last-table-element-in-the-stack-of-open-elements. > and > 2. node must be inserted in the stack of open elements, immediately before > the-last-table-element. > > I'm assuming you meant reading #1. Yeah. Fixed. EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below, which hopefully clarifies most of the points raised herein. Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r5161. Check-in comment: Some parser clarifications. http://html5.org/tools/web-apps-tracker?from=5160&to=5161