Closed Bug 24723 Opened 25 years ago Closed 25 years ago

DOMException not thrown for CharacterData->deleteData method for offset values greater than data length.

Categories

(Core Graveyard :: Java APIs for DOM, defect, P3)

Sun
Solaris
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rpallath, Assigned: akhil.arora)

Details

Attachments

(2 files)

According to W3C docs.
for method deleteData(offset, count) of Character
if the offset value is  greater than the value of length of the string, then
it should  throw a DOMException.

Right now it throws out RuntimeException instead of DOMException.

The test case simply creates a Text Node with a valid text value and tries to
deleteData from offset set  to Integer.MAX_VALUE

To execute.

Build mozilla-bin
Follow instructions in mozilla/java/dom/tests/src/README

then from command line execute
sh autorun.sh -t org.mozilla.dom.test.CharacterDataImpl_deleteData_init_int_4

(choose 'HTML' option from the 3 choices).

log files are in dir. mozilla/java/dom/tests/src/logs

Attached is debug log and the testcase java file.

Below is the exception thrown

============================================================================
java.lang.RuntimeException: (e.1) CharacterData.deleteData: failed
        at org.mozilla.dom.CharacterDataImpl.deleteData(Native Method)
        at org.mozilla.dom.test.CharacterDataImpl_deleteData_int_int_4.execute(C
ompiled Code)
        at org.mozilla.dom.test.TestLoader.loadTest(Compiled Code)
        at org.mozilla.dom.TestListener.endDocumentLoad(Compiled Code)
        at org.mozilla.dom.DOMAccessorImpl.endDocumentLoad(Compiled Code)
Caught RuntimeException java.lang.RuntimeException: (e.1) CharacterData.deleteDa
ta: failed
============================================================================
Status: NEW → ASSIGNED
the bug is fixed
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Verified mozilla branch  Netscape_6_1_RELEASE and blackwood 
branch JAVADEV_6_1_20010831 on NT and on Sparc Solaris 2.8.
Now DOMException is throwned and test passed.
Status: RESOLVED → VERIFIED
QA Contact: leila.garin → avm
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: