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)

x86
Windows 98
defect
Not set
normal

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".
Attached file testcase
Keywords: testcase
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 ...>.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Use document.documentElement...
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: