W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Error in DOM spec? CharacterData interface

From: Jan-Arve Saeter <jana@birdstep.org>
Date: Wed, 19 Sep 2001 09:59:35 +0200
Message-ID: <9BF5DD8B8F3CD411959500B0D020ED3E2B7099@EXCHANGE>
To: www-dom@w3.org
interface CharacterData : Node {

void               deleteData(in unsigned long offset, 
                                in unsigned long count)
                                        raises(DOMException);

}

Exceptions 
DOMException
 INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than
the number of 16-bit units in data, or if the specified count is negative.

How can the count be negative if the count parameter is an unsigned long?
The DOM Level 1 NIST conformance tests actually test on this by passing a
negative value.
Isn't this an error in the specification or is this just added to actually
give a hint
to bindings that don't support unsigned numbers (like Java (?)) ?

To examplify: 
We have made an interface in C++ that of course uses an unsigned number, 
and we have made a JNI interface on top of this to actually "conformance"
test 
the C++ implementation with the NIST Java conformance tests.

If Java passes a negative number, this will be translated to a large
unsigned number in C++ 
and the behaviour of these two different possibilities are specified to be
different.

Because the DOM Level 2 spec says:
"If the sum of offset and count exceeds length then all 16-bit units from
offset to the end of the data are deleted."

Could somebody clarify this to me?

;--------------------------------
Jan-Arve Sæther, System Developer
Birdstep Technology ASA
Tel: 24134752
Received on Wednesday, 19 September 2001 04:14:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:49 GMT