Closed
Bug 11238
Opened 25 years ago
Closed 23 years ago
node.replaceChild("",newNode) crashes Mozilla
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
M10
People
(Reporter: rcv64032, Assigned: vidur)
References
Details
(Keywords: crash, Whiteboard: [TESTCASE] crash from js. Fix available - waiting for tree opening.)
Attachments
(1 file)
246 bytes,
text/html
|
Details |
<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>
Updated•25 years ago
|
Whiteboard: MAKINGTEST mdubinko@yahoo.com
Comment 2•25 years ago
|
||
Updated•25 years ago
|
Whiteboard: MAKINGTEST mdubinko@yahoo.com → [TESTCASE] crash from js
Comment 3•25 years ago
|
||
Tested on Win98 19990809 build. The "" case didn't crash, but the null case did (as the attached file demonstrates)
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [TESTCASE] crash from js → [TESTCASE] crash from js. Fix available - waiting for tree opening.
Target Milestone: M10
Assignee | ||
Comment 4•25 years ago
|
||
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.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•25 years ago
|
||
Fix checked in on 8/19/1999. Null check added.
Updated•24 years ago
|
Component: DOM Level 1 → DOM Core
Comment 10•23 years ago
|
||
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 → ---
Comment 11•23 years ago
|
||
is this bug still valid?
Comment 12•23 years ago
|
||
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?
Comment 13•23 years ago
|
||
See bug #56758
Assignee | ||
Comment 14•23 years ago
|
||
As Brian King points out, an existing bug reflects remaining problems with replaceChild. I'm closing this one.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 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.
Description
•