Closed
Bug 83363
Opened 24 years ago
Closed 24 years ago
crash if insertNode tries to add non-existent node
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: mail, Assigned: anthonyd)
References
Details
(Keywords: crash, Whiteboard: [range], FIX IN HAND; will check in soon)
Attachments
(3 files)
414 bytes,
text/html
|
Details | |
367 bytes,
text/html
|
Details | |
7.01 KB,
patch
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9+) Gecko/20010525
BuildID: 2001052504
Using the DOM 2 Range insertNode method, mozilla crashes if the node which is
being inserted does not exist. I would think an exception should be raised, but
I don't see one in the spec.
Reproducible: Always
Steps to Reproduce:
1. run testcase
2. browser crashes
Actual Results: Crash
Expected Results: Exception or script error
![]() |
Reporter | |
Comment 1•24 years ago
|
||
![]() |
Reporter | |
Comment 2•24 years ago
|
||
![]() |
Reporter | |
Comment 3•24 years ago
|
||
I've added two testcase... one with a try catch statement and one without. The
one with the try-catch does not crash, while the one without crashes my machine.
I'm not sure where to draw the line between what the developer should check for
and what the browser should check for, but since this is a fundamental part of
the spec. and it seems that there will be many accidental cases of trying to add
a nonexistent node, then maybe it should throw an exception.
I'm going to change the severity to critical since this is a crash bug report.
Severity: minor → critical
Keywords: crash
on it, i missed this. sorry.
anthonyd
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.2
![]() |
Reporter | |
Comment 6•24 years ago
|
||
Also crashes if the node to insert is already a descendant of the Range as well,
so it may crash upon any of the exceptions when not using try catch.
![]() |
||
Updated•24 years ago
|
Whiteboard: [range]
i have a fix for this, need to patch it up and get it attached here.
anthonyd
im attaching a patch for this, it is only a one liner, the rest of the patch is
just other fixes for range that are descreibed in other bugs, and I didnt feel
like breaking out just one line. I will however paste it here:
nsRange::InsertNode line 1757:
NS_ENSURE_ARG_POINTER(aN);
Whiteboard: [range] → [range], FIX IN HAND
![]() |
||
Updated•24 years ago
|
Whiteboard: [range], FIX IN HAND → [range], FIX IN HAND need r=, sr=
![]() |
Assignee | |
Comment 10•24 years ago
|
||
got an r= from mjudge, and a sr= from kin.
sending to drivers@mozilla.org for approval to check in.
anthonyd
Comment 11•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Updated•24 years ago
|
Whiteboard: [range], FIX IN HAND need r=, sr= → [range], FIX IN HAND; will check in soon
![]() |
Assignee | |
Comment 12•24 years ago
|
||
fix checked in
anthonyd
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•