Bug 13347 - XMLDom node attributes case is being overridden to lower case???
Summary: XMLDom node attributes case is being overridden to lower case???
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Major
Assignee: Jinwoo Song
URL: http://www.mlb.com/fantasy/bts/index.jsp
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 12:37 PDT by Sam
Modified: 2019-02-06 09:03 PST (History)
6 users (show)

See Also:


Attachments
Patch (17.13 KB, patch)
2012-12-05 17:11 PST, Jinwoo Song
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam 2007-04-13 12:37:04 PDT
I have develloped a JavaScript component that converts XMLDom (AJAX) document into an equivalent JavaScript Object, preserving both node and attribute names. Recently I was trying to fix a site that utilizes this component and is working on every other browser except Safari. What I have discovered shocked me. It turns out that when i'm iterating through XMLNodeAttributes collection all the attribute names are returned in lower case thus overriding what was initialy set in XML. Since I use case sensative way to access attribute values in JavaScript Object, those attributes that had both caps and lower case become inaccessible and logic breaks.
Comment 1 David Kilzer (:ddkilzer) 2007-04-13 18:54:34 PDT
Hi Sam, thanks for the bug report!  Have you tried running this on a WebKit nightly build?  There have been many improvements since Safari 2.0.x in the WebKit browser engine.  http://nightly.webkit.org/

Comment 2 Alexey Proskuryakov 2007-04-22 02:55:25 PDT
The bug URL is 404 now. Also, there is no such thing as XMLNodeAttributes in WebKit, so it's hard to re-create the problem from description.

If I were to guess, this is indeed a bug that has been fixed: the following snippet works in nightly builds, but not in shipping Safari.

doc = (new DOMParser).parseFromString("<doc Attr1='1' attr1='11'/>", "application/xml");
for (i = 0; i < doc.documentElement.attributes.length; ++i)
   document.write("<p>" + doc.documentElement.attributes[i].name + "</p>");

Please reopen this bug if your case is different, and still fails in nightly builds.
Comment 3 Jinwoo Song 2012-12-05 17:11:27 PST
Reopening to attach new patch.
Comment 4 Jinwoo Song 2012-12-05 17:11:31 PST
Created attachment 177874 [details]
Patch
Comment 5 Jinwoo Song 2012-12-05 17:14:02 PST
Comment on attachment 177874 [details]
Patch

I'm sorry to apply my patch to wrong bug number. It was a patch for bug 103347 not 13347.
Comment 6 Lucas Forschler 2019-02-06 09:03:04 PST
Mass moving XML DOM bugs to the "DOM" Component.