This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10338 - End tag of </td> or </th> in "in cell" mode wrongly asserts current node will be "tr"
Summary: End tag of </td> or </th> in "in cell" mode wrongly asserts current node will...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P1 critical
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 23:25 UTC by Eric Seidel
Modified: 2010-10-04 13:56 UTC (History)
5 users (show)

See Also:


Attachments

Description Eric Seidel 2010-08-09 23:25:09 UTC
End tag of </td> or </th> in "in cell" mode wrongly asserts current node will be "tr"

http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-intd

The passage:

Switch the insertion mode to "in row". (The current node will be a tr element at this point.)

The current node will not necessarily be a tr in the fragment case.

WebKit had this as an ASSERT in our TreeBuilder:
http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTreeBuilder.cpp?rev=65006#L2000

But that ASSERT is false in the case of:

<table><tr></tr></table>
<script>
    rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; ++i)
        rows[i].innerHTML += "<td>foo</td>";
</script>

Assuming I"m understanding the fragment case and how innerHTML is supposed to work correctly.

I recommend changing "(The current node will be a tr element at this point.)" to "(The current node will be a tr element at this point, except in the fragment case.)"

In the fragment case the "context element" must be a tr for this to be allowed (I think).
Comment 1 Eric Seidel 2010-08-09 23:27:53 UTC
The example HTML came from:
http://trac.webkit.org/browser/trunk/LayoutTests/fast/table/rowindex.html
Comment 2 Ian 'Hixie' Hickson 2010-08-16 19:30:01 UTC
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: Partially Accepted
Change Description: see diff given below
Rationale: I just removed the note altogether, since it isn't so helpful when it's a complicated condition, and the spec doesn't usually have asserts like this.
Comment 3 contributor 2010-08-16 19:30:37 UTC
Checked in as WHATWG revision r5296.
Check-in comment: remove incorrect comment
http://html5.org/tools/web-apps-tracker?from=5295&to=5296