W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2008

DOM2 - Range- ambiguity in surroundContents exceptions

From: Germain Garand <germain@ebooksfrance.org>
Date: Thu, 3 Apr 2008 14:04:30 +0200
To: www-dom@w3.org
Message-Id: <200804031404.31009.germain@ebooksfrance.org>


I believe there is an ambiguity in the way the HIERARCHY_REQUEST_ERR exception 
is defined for the DOM Level2 Range's surroundContents method:

"HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is 
of a type that does not allow children of the type of newParent "

2.2.1: "If the container is a CharacterData, Comment or ProcessingInstruction 
node, the offset is between the 16-bit units of the UTF-16 encoded string 
contained by it."

It is therefore implied that the 'container' of a textual boundary point is 
the text node itself.

In those conditions, according to the exception definition, surrounding a 
textual range X with an element node Y should raise, as Y (newParent) is of a 
type that is not allowed in the container of the start of the Range X.

at the same time, the examples of 2.10 make clear that such a surrounding is 

"     Before:

     After surroundContents(FOO):

(emphasis of Range with [] characters)

Received on Thursday, 3 April 2008 12:06:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:13 UTC