Order of table sections (Re: Minutes from telcon 20020920)

> pettit1 : HTMLTableRowElement.rowIndex
>
> Brad: within the table definition, order is different from how they
> appear.
>
> -> OPEN ISSUE for WG.

The tests HTMLTableRowElement01 and 04 rely on the order of the table
sections in the DOM tree. They look for a certain row using
document.getElementsByTagName("tr").item(4). This assumes the useragent
doesn't sort the table sections during parsing.

Konqueror currently sorts the table sections (to the visual order,
thead/tbodies/tfoot), but the table rendering guys say this isn't
necessary anymore, and should probably be fixed so that the DOM tree can
be "mapped back to the input file".

But is this really considered a bug, or are user-agents free to order or
not order the table sections in the DOM tree?
What does Mozilla do? What does IE do? (I suppose at least one of them
reorders the sections too, since the issue is mentionned here?)

If the answer is that useragents are free to do so, then those tests
should be changed, e.g. with <tr id="therowtotest"> and
testNode=document.getElementById("therowtotest"). This would allow testing
rowIndex and sectionRowIndex without relying on the order of the sections.
(Hmm, at least sectionRowIndex. rowIndex has sort of the same problem:
is it the index in the dom tree, or the index on screen, i.e. with TFOOT
at the bottom?)

If sections shouldn't be reordered, a specific test for that would be
easier to debug than noticing it as a side effect of the current tests'
failure - so I suggest doing the getElementById change anyway.

Thanks,
David.

Received on Thursday, 26 September 2002 07:23:04 UTC