HTMLTableElement.insertRow(-1) ambiguous

"Brad Pettit" <[email protected]>
Newsgroups gmane.comp.web.dom.general,gmane.comp.web.dom.test-suites.general
Message-ID <3013537455C0D1459746B2AE2DF47AEA0521F421@svc-msg-01.northamerica.corp.microsoft.com>
The DOM TS is at odds with recent changes to the the HTML DOM.

Specifically, I'm referring to HTMLTableElement::insertRow and how it behaves with a rowIndex of -1.
The recent change to the spec was that rows are numbered in logical order (THEAD* TBODY+ TFOOT*) instead
of document/DTD order (THEAD* TFOOT* TBODY+) to conform with existing implementations.

insertRow(-1) is supposed to append a row to the table:
	"If index is -1 or equal to the number of rows, the new row is appended"
	<http://www.w3.org/TR/2002/PR-DOM-Level-2-HTML-20021108/html.html#ID-39872903>

The test case at http://dev.w3.org/cvsweb/2001/DOM-Test-Suite/tests/level2/html/HTMLTableElement39.xml
doesn't take this change into account.

From the description of insertRow(-1) -- as well as the previous behavior -- I surmise that the intent was to append a row to the last TBODY, not to the TFOOT. However, because the rows in a table are numbered with TFOOT rows at the end, it's not clear to which section insertRow should append: The last existing section? The TFOOT? The TBODY?

Our tests with Netscape 7 indicate that it doesn't support -1 as a parameter to insertRow.

My questions: what is the correct behavior, and should the spec be updated?

Brad Pettit
Microsoft Corp.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.