Closed Bug 76057 Opened 25 years ago Closed 25 years ago

document.createElement().tagName, .nodeName not case-sensitive

Categories

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

x86
Windows 95
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: WeirdAl, Assigned: jst)

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95) BuildID: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; 0.8.1) Gecko/20010323 Mozilla is returning a tag generated from lowercase letters as uppercase. Reproducible: Always Steps to Reproduce: 1. Run the following code in Mozilla as an HTML page.] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html> <body> <script language="JavaScript" type="text/javascript"> <!-- x = document.createElement("span") alert(x.tagName) //--> </script> </body> </html> Actual Results: Alert window containing "SPAN". Expected Results: Alert window containing "span". For HTML, this is not a major problem. But for XHTML 1.0, and possibly for XML documents in general, this is not helpful to the cause. Possibly related to bug #76054, which I just posted. (At this time, the other bug is still unconfirmed.)
Summary: document.createDocument().tagName() not case-sensitive → document.createDocument().tagName not case-sensitive
Oops -- included second <html> tag by mistake. Corrected page is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> <script language="JavaScript" type="text/javascript"> <!-- x = document.createElement("span") alert(x.tagName) //--> </script> </body> </html>
Summary: document.createDocument().tagName not case-sensitive → document.createElement().tagName, .nodeName not case-sensitive
If you get 'SPAN' when loading your testcase you must have been feeding it to mozilla as text/html and not text/xml, see the attached testcase. Also, you had your whole script commented out, doing that will make mozilla not see the script (intentionally), skip the '<!--' and '-->' inside your <script> tag and things will start working. Having the comments in the <script> tags is a HTML:ism that shouldn't be used in XML/XHTML. Marking WORKSFORME.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
Thanks for the info. I finally got it to work. I changed the extension for .htm (or .html) to .xml and it worked.
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
verified
Status: RESOLVED → VERIFIED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: