Closed Bug 3302 Opened 26 years ago Closed 26 years ago

SetAttribute not working

Categories

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

x86
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: hyatt, Assigned: waterson)

Details

(Whiteboard: 3/25: Requested developer to verify)

I've had several complaints that SetAttribute isn't working properly. An assertion is being thrown. (In the test case, no namespace is specified.)
It appears that GetResource has a precondition that the namespace not be unknown. So SetAttribute never works.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed this by allowing kNameSpaceID_None to match _any_ attribute in GetAttribute(), and making ParseAttributeString() return kNameSpaceID_None instead of kNameSpaceID_Unkown. Also, needed to fix no-namespace case in nsRDFXULBuilder.cpp.
David, please can you verify this bug fix or provide a testcase to verify it. I've tried the following file but we don't have the right environment to catch any assertion: <HTML> <HEAD> <TITLE>MyPage</TITLE> </HEAD> <BODY> <SCRIPT TYPE="text/javascript"> // object reference to HTML Body element var oBody = document.firstChild.childNodes.item(1); oBody.setAttribute("myproperty", "foo"); document.write(oBody.getAttribute("myproperty")); </SCRIPT> </BODY> </HTML> Thanks!
Whiteboard: 3/25: Requested developer to verify
Status: RESOLVED → VERIFIED
Marked verified: tons of XUL code is using this.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.