Closed Bug 258564 Opened 20 years ago Closed 20 years ago

Inconsistent Behaviour in DOM while trying to sort a table

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 26179

People

(Reporter: daniel.oconnor, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3

In the first example it works fine, in the second example inconsitent behaviour
is shown.

Selects wrong column to highlight.


Reproducible: Always
Steps to Reproduce:
1. Click a header
2. Try to click another header

Actual Results:  
See tablesort2.html : Incorrect column highlighted and sorted, then will no
longer work.

Expected Results:  
See tablesort.html : correctly sort table
Component: DOM: Traversal-Range → DOM
Is returnColumnClicked returning the wrong column number?

What exactly is the difference between the two testcases?  Both have a lot of
extraneous stuff not relevant to this bug, which makes debugging very difficult...
(In reply to comment #1)
> Is returnColumnClicked returning the wrong column number?
> What exactly is the difference between the two testcases?  Both have a lot of
> extraneous stuff not relevant to this bug, which makes debugging very 
difficult...

Yeah... sorry about that; its rather... verbose.
There is *no* difference between either except for the contents of the 
<table></table>
So something, somewhere, has decided it doesn't like it.
The key difference here is between:

<tr>
<td>ID</td><td>Description</td><td>Qty</td><td>Unit</td>
</tr>

and 

<tr><td>First Name</td><td>Middle Name</td><td>Last Name</td><td>Age</td></tr>

Note the whitespace differences.  In the first case, the firstChild of the table
row is a #text node; in the second case it's a <td> Element node.  In IE, it's
the Element node in both cases; IE magically loses the #text nodes somehow.

Removing that whitespace makes things work.

The script needs to be fixed not to make incorrect assumptions about the DOM...
see bug 

*** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.