Patch: HTMLTableElement31.xml tried to add <table> to <table>

David Faure <[email protected]>
Newsgroups gmane.comp.web.dom.test-suites.general
Message-ID <[email protected]>
HTMLTableElement31 says it will create a new table and append it to the
document. However it instead creates a table and tries to insert it into
another (empty) table. This is apparently forbidden, per the DOM/HTML
spec.

This isn't what the test says it will do, so I think it's a bug in the
test. What about this fix for it?

Index: HTMLTableElement31.xml
===================================================================
RCS file: /sources/public/2001/DOM-Test-Suite/tests/level2/html/HTMLTableElement31.xml,v
retrieving revision 1.4
diff -u -p -r1.4 HTMLTableElement31.xml
--- HTMLTableElement31.xml      2002/08/22 04:53:15     1.4
+++ HTMLTableElement31.xml      2002/09/25 22:53:01
@@ -59,7 +59,7 @@ See W3C License http://www.w3.org/Consor
 <childNodes obj="testNode" var="tableList"/>
 -->
 <createElement obj="doc" var="table" tagName='"table"'/>
-<appendChild obj="testNode" newChild="table" var="tableNode"/>
+<appendChild obj="testNode.parentNode" newChild="table" var="tableNode"/>
 <getElementsByTagName interface="Document" obj="doc" var="nodeList" tagname='"table"'/>
 <assertSize collection="nodeList" size="2" id="tableSize2"/>
 <tBodies interface="HTMLTableElement" obj="tableNode" var="tbodiesnodeList"/>

This adds the new table as a (last) sibling to the existing empty table,
i.e. to a node where we know tables are allowed - and it makes the test
work for me.

David.
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.