Closed Bug 11238 Opened 25 years ago Closed 23 years ago

node.replaceChild("",newNode) crashes Mozilla

Categories

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

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: rcv64032, Assigned: vidur)

References

Details

(Keywords: crash, Whiteboard: [TESTCASE] crash from js. Fix available - waiting for tree opening.)

Attachments

(1 file)

<HTML>
<BODY>
<SCRIPT>
	hr = document.createElement("HR");
	document.body.appendChild(hr);
	document.body.replaceChild("",hr);	//<-- using null or "" as first argument causes a crash
</SCRIPT>

</BODY>
</HTML>
*** Bug 11237 has been marked as a duplicate of this bug. ***
Whiteboard: MAKINGTEST mdubinko@yahoo.com
Whiteboard: MAKINGTEST mdubinko@yahoo.com → [TESTCASE] crash from js
Tested on Win98 19990809 build. The "" case didn't crash, but the null case did
(as the attached file demonstrates)
Status: NEW → ASSIGNED
Whiteboard: [TESTCASE] crash from js → [TESTCASE] crash from js. Fix available - waiting for tree opening.
Target Milestone: M10
Need to do better argument checking across the board in the DOM. I have a fix
for the immediate problem in my tree (waiting for tree opening). The failure
right now is still silent. For M10, I have the larger task of doing better error
reporting.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix checked in on 8/19/1999. Null check added.
Adding crash keyword
Keywords: crash
Mass update of qa contact
QA Contact: gerardok → janc
Component: DOM Level 1 → DOM Core
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
the browser does not crash anymore ....
1) uncomment the line which says document.body.replaceChild (hr, b); the button 
disappears but i was expecting to see one more horizontal line 
2) comment out line 2 in javascript u will see the horizontal line which 
replaces button 
3) replaceChild in line 3 does not replace hr with null...i was expecting to see 
nothing on the screen...

<HTML>
<BODY>
<SCRIPT>
        hr = document.createElement("HR");
        document.body.appendChild(hr);
        //document.body.replaceChild(null,hr); 
	b = document.createElement("BUTTON");
	b.value="button";
	document.body.appendChild(b); 
	//document.body.replaceChild (hr, b); //---uncomment this
	
</SCRIPT>
</BODY>
</HTML>
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
is this bug still valid?
Sivakiran, I think this bug was only about the crash, which no longer happens
since we check for a null NewChild argument and return NS_ERROR_INVALID_POINTER
if it's null. If some feature of replaceChild doesn't work correctly, shouldn't
it be filed as a separate bug?
As Brian King points out, an existing bug reflects remaining problems with
replaceChild. I'm closing this one.
Status: REOPENED → RESOLVED
Closed: 25 years ago23 years ago
Resolution: --- → FIXED
marking verified
Status: RESOLVED → VERIFIED
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

Creator:
Created:
Updated:
Size: