Closed Bug 181791 Opened 23 years ago Closed 23 years ago

[FIX]getElementsByTagNameNS(null, <whatever>) does not work

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.3alpha

People

(Reporter: cesarb, Assigned: bzbarsky)

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021123 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021123 When you have a element with a null namespace, getElementsByTagNameNS(null, tagname) should find it. This is not working. The workaround of getElementsByTagName(tagname) works. Reproducible: Always Steps to Reproduce: 1.Open testcase 2.Click the button It will show how many elements were found. Actual Results: 0 elements were found Expected Results: Found the <data xmlns="">...</data> element (the alert should show 1)
Attached file Simple testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assigning to bzbarsky as requested by him on IRC
Assignee: jst → bzbarsky
Attached patch Need to check for empty string (obsolete) — Splinter Review
Attachment #107306 - Flags: superreview?(jst)
Attachment #107306 - Flags: review?(bugmail)
Priority: -- → P2
Summary: getElementsByTagNameNS(null, <whatever>) does not work → [FIX]getElementsByTagNameNS(null, <whatever>) does not work
Target Milestone: --- → mozilla1.3alpha
I think that what we really want to do is fix FindNamespaceID to work with the empty string also, rather than do a special hack here.
I considered that, but there may be other callers relying on the current behavior... if there are not, I'm all for changing it.
I think you should be fine. There are two versions of FindNameSpaceID in the file. One is internal and is used only in the two places you changed. The other is on the interface and does different things.
Attached patch Fine, you winSplinter Review
Attachment #107306 - Attachment is obsolete: true
Attachment #107306 - Flags: superreview?(jst)
Attachment #107316 - Flags: superreview?(jst)
Attachment #107316 - Flags: review?(bugmail)
Comment on attachment 107316 [details] [diff] [review] Fine, you win >@@ -455,26 +460,23 @@ > PRInt32& aNameSpaceID) > { > NS_ASSERTION(!gNameSpaceManagerWasShutDown, > "Namespace manager used past content module shutdown!!!"); > > PRInt32 id = FindNameSpaceID(aURI); >- >+ feel free to not do this change. I don't really care either way though. >+ if (!uri) >+ return NS_ERROR_OUT_OF_MEMORY; Nit (since you didn't add this): I prefer NS_ENSURE_TRUE(uri, NS_ERROR_OUT_OF_MEMORY), not a biggie though
Attachment #107316 - Flags: review?(bugmail) → review+
Comment on attachment 107316 [details] [diff] [review] Fine, you win sr=jst, but please don't add spaces for indentation on empty lines :-)
Attachment #107316 - Flags: superreview?(jst) → superreview+
fixed. I took the whitespace change out.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
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: