Closed Bug 274855 Opened 20 years ago Closed 20 years ago

error in building DOM tree : 'enter' or 'space' symbol between two elements interprets as a text comment

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: k_glavatskiy, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

consider the html sample :
<div>text1</div>
<div>text2</div>
accordind to the specification 'this.nextSibling' for the first "div" shoud
point to the second "div". But it doesnt happen until we print next html sample
<div>text1</div><div>text2</div>


Reproducible: Always

Steps to Reproduce:
1.create next html sample:
<html>
<body>
<div onclick="alert(this.nextSibling.tagName)">first</div>
<div>second</div>
</body>
</html>
2. run html page and click the word "first"


Actual Results:  
JavaScript shows the message box with text "undefined"

Expected Results:  
JavaScript should show the message box with text "DIV"
> accordind to the specification 'this.nextSibling' for the first 
> "div" shoud point to the second "div".

Which spec?

FWIW, it is not a text comment but a text node with white space content.
Assignee: firefox → parser
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: firefox.general → mrbkap
Version: unspecified → Trunk
The DOM Level 2 Core spec leaves this up to the parser. Marking invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.