Last Comment Bug 57495 - getElementsByTagName() with uppercase parameter broken
: getElementsByTagName() with uppercase parameter broken
[rtm++][HAVE FIX][zarro riisk :-)]
: regression
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All Other
P2 normal (vote)
: ---
Assigned To: Johnny Stenback (:jst,
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2000-10-20 23:13 PDT by dannyg
Modified: 2008-07-31 02:27 PDT (History)
0 users
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Proposed fix (1.50 KB, patch)
2000-10-20 23:34 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
New XHTML safe fix (1.32 KB, patch)
2000-10-24 15:23 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
New XHTML safe fix without some unnecessary cleanup (1008 bytes, patch)
2000-10-24 15:24 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
Final XHTML safe fix, I'm done now, really (1.68 KB, patch)
2000-10-24 15:27 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review

Description User image dannyg 2000-10-20 23:13:57 PDT
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.
Comment 1 User image Johnny Stenback (:jst, 2000-10-20 23:32:54 PDT
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.
Comment 2 User image Johnny Stenback (:jst, 2000-10-20 23:34:02 PDT
Created attachment 17702 [details] [diff] [review]
Proposed fix
Comment 3 User image dannyg 2000-10-23 11:47:29 PDT
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.
Comment 4 User image Nisheeth Ranjan 2000-10-23 17:29:31 PDT
Comment 5 User image Nisheeth Ranjan 2000-10-24 11:42:43 PDT
Marking rtm need info while jst gets a super review for his fix.
Comment 6 User image Johnny Stenback (:jst, 2000-10-24 15:22:12 PDT
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.
Comment 7 User image Johnny Stenback (:jst, 2000-10-24 15:23:02 PDT
Created attachment 17916 [details] [diff] [review]
New XHTML safe fix
Comment 8 User image Johnny Stenback (:jst, 2000-10-24 15:24:18 PDT
Created attachment 17917 [details] [diff] [review]
New XHTML safe fix without some unnecessary cleanup
Comment 9 User image Johnny Stenback (:jst, 2000-10-24 15:27:04 PDT
Created attachment 17918 [details] [diff] [review]
Final XHTML safe fix, I'm done now, really
Comment 10 User image Eric Pollmann 2000-10-26 15:59:38 PDT
r=pollmann.  This is an extremely low risk fix.
Comment 11 User image vidur (gone) 2000-10-26 16:31:53 PDT
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.
Comment 12 User image Johnny Stenback (:jst, 2000-10-26 17:54:18 PDT
Marking rtm+, hoping to get this marked as a limbo bug...
Comment 13 User image Jim Roskind 2000-10-26 21:45:07 PDT
Please land this on the trunk asap to get some back time, while we keep this in
limbo for the N 6 branch.
Comment 14 User image Johnny Stenback (:jst, 2000-10-27 02:02:21 PDT
Thank you, the fix is now checked into the trunk.
Comment 15 User image Phil Peterson 2000-10-27 15:34:22 PDT
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.
Comment 16 User image selmer (gone) 2000-10-30 12:19:18 PST
PDT marking [rtm++]. This bug is now out of limbo and approved for checkin to
the branch. Please check in ASAP.

Comment 17 User image Johnny Stenback (:jst, 2000-10-30 13:19:39 PST
Fix checked into the branch, marking FIXED.
Comment 18 User image Peter Trudelle 2000-10-31 23:20:05 PST
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
Comment 19 User image Kathleen Brade 2000-11-01 10:12:28 PST
using the ns6 build from 2000103114 on Macintosh, I now get 2 for each dialog
(unlike Peter).
Comment 20 User image Nisheeth Ranjan 2000-11-01 13:11:04 PST
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.
Comment 21 User image Jan Carpenter 2000-11-07 18:18:24 PST
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
Comment 22 User image Prashant Desale 2001-03-06 16:22:33 PST
QA contact Update
Comment 23 User image Prashant Desale 2001-06-05 12:08:03 PDT
Updating QA contact to Shivakiran Tummala.
Comment 24 User image Sivakiran Tummala 2001-07-19 13:24:23 PDT

Note You need to log in before you can comment on or make changes to this bug.