previousSibling and nextSibling point to textNode rather than element

VERIFIED DUPLICATE of bug 26179

Status

()

--
major
VERIFIED DUPLICATE of bug 26179
18 years ago
10 years ago

People

(Reporter: David.R.Gardiner, Assigned: jst)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
It seems to me that previousSibling and nextSibling should point to the next
element, rather than the whitespace between elements.

Mozilla seems to think that the whitespace (in this testcase, tab and carriage
return/linefeed) contitutes an element, and so points to that as the previous or
next sibling.

In contrast, IE reports the previous or next <LI> element as the siblings. (I'm
not saying IE is wonderful, just pointing out how it interprets things.)

-dave
(Reporter)

Comment 1

18 years ago
A couple of things i forgot to mention:

1. This occurs in lastest builds from CVS.

2. I noticed that Johnny commented in Bug #31560 that this is what Mozilla 
does, but didn't really explain why.. 

It seems to me that what users and the DOM would expect would to be ignore the 
whitespace.

I don't mind this bug being marked a dup of 31560 if you can show me where in 
the DOM spec that the whitespace/text between elements counts as far as 
siblings are concerned. 

Maybe it's something that isn't covered in the DOM, but i think it would be 
good to highlight the fact that Mozilla does implement this differently to 
other browsers (if it is indeed implementing it correctly)

-dave

Comment 2

18 years ago
See also bug 26179.

*** This bug has been marked as a duplicate of 26179 ***
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE
Component: DOM Level 1 → DOM Core

Comment 4

18 years ago
VERIFIED duplicate
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: jcarpenter0524 → general
You need to log in before you can comment on or make changes to this bug.