Closed
Bug 311132
Opened 20 years ago
Closed 20 years ago
document.firstChild.nodeName and .tagName don't return "HTML"
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: moz, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file)
|
1014 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
In any HTML document
document.firstChild.nodeName returns "html",
document.firstChild.tagName returns "undefined".
Both must return "HTML".
Reproducible: Always
Steps to Reproduce:
1. see Testcase (coming soon)
Actual Results:
document.firstChild.nodeName returns "html",
document.firstChild.tagName returns "undefined".
Expected Results:
document.firstChild.nodeName returns "HTML",
document.firstChild.tagName returns "HTML".
If you check firstChild.nodeType you will notice that the first child of your
document is the DocumentType. It doesn't have a tagName and the 'html' is taken
from <!DOCTYPE html ...>.
Updated•20 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Comment 3•20 years ago
|
||
Use document.documentElement...
You need to log in
before you can comment on or make changes to this bug.
Description
•