Closed Bug 57495 Opened 25 years ago Closed 25 years ago

getElementsByTagName() with uppercase parameter broken

Categories

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

All
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: dannyg, Assigned: jst)

Details

(Keywords: regression, Whiteboard: [rtm++][HAVE FIX][zarro riisk :-)])

Attachments

(4 files)

I'm filing this as a new bug since my comment in a related bug (56257) hasn't raised any flags. This is a serious one: Invoking getElementsByTagName() from any node _other_ than the root #document node has changed between M17 and M18 to require all lowercase tag name parameters. Try it on this page. In the Address field enter: javascript:void alert(document.body.getElementsByTagName("FORM").length) Result is zip, zero, nada. Now enter: javascript:void alert(document.body.getElementsByTagName("form").length) and you get the two forms in this page. Since the Element.tagName property returns tag names in all uppercase, and since IE and PR2 work with all uppercase parameters to this method, this needs to be fixed pronto. All of my developmental XML scripts no longer work in NN6.
This is indeed a bug in mozilla, however, since you're talking about XML scripts I get a bit confused. Everything is and should be case sensitive in XML documents, including XHTML documents, so I don't see how this bug could cause problems in XML files, especially not in XHTML files where everything is lowercase? I'll attach a patch that fixes this, and nominating for rtm.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: P3 → P2
Attached patch Proposed fixSplinter Review
They're not XML scripts per se, but rather scripts that work with XML elements embedded within an HTML document. IOW, stuffing some XML from a database into an HTML document, and then using JavaScript on the client to convert the data into convenient arrays of objects to facilitate sorting (etc.) to go beyond XSLT. Thanks for seeing to this one.
r=nisheeth.
Marking rtm need info while jst gets a super review for his fix.
Whiteboard: [rtm need info]
I just realized (while talking to Vidur about this) that the attached patch makes it impossible to find upper-case elements within an XHTML element, I'll attach a new patch that fixes that.
r=pollmann. This is an extremely low risk fix.
sr=vidur. The fix looks pretty good. Since we're going from having strong case requirements for the tagname parameter to weaker case requirements, I feel pretty good about this.
Marking rtm+, hoping to get this marked as a limbo bug...
Whiteboard: [rtm need info] → [rtm+][HAVE FIX][zarro riisk :-)]
Please land this on the trunk asap to get some back time, while we keep this in limbo for the N 6 branch.
Thank you, the fix is now checked into the trunk.
This bug is in candidate limbo. We will reconsider this fix once we have a candidate in hand, but we can't take this fix before then.
PDT marking [rtm++]. This bug is now out of limbo and approved for checkin to the branch. Please check in ASAP.
Whiteboard: [rtm+][HAVE FIX][zarro riisk :-)] → [rtm++][HAVE FIX][zarro riisk :-)]
Fix checked into the branch, marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I now get the inverse result ("FORM" yields '2', "form" nada) using the 10-31-14 MN6 candidate build on Win98. Is that correct? If so, consider verified on one platform.
using the ns6 build from 2000103114 on Macintosh, I now get 2 for each dialog (unlike Peter).
I just tried this on NT using the 10-30-14 branch builds and I got 2 for both "FORM" and "form". Marking with the vtrunk keyword, so that this bug is also verified on the trunk.
Keywords: vtrunk
verified: 2000-11-06-09-MN6 : win32 2000-11-06-09-MN6 : linux 2000-11-06-08-MN6 : mac 2000-11-07-08-Mtrunk : linux Locks up the browser on these trunk builds: 2000-11-07-08-Mtrunk : win32 2000-11-07-08-Mtrunk : mac
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
verified
Status: RESOLVED → VERIFIED
Component: DOM: HTML → 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: