W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1999

Re: Question about DOM2 Range

From: Lauren Wood <lauren@sqwest.bc.ca>
Date: Mon, 20 Dec 1999 10:03:08 -0800
Message-Id: <199912201805.KAA32063@mail.sqwest.bc.ca>
To: www-dom@w3.org
On 20 Dec 99, at 6:25, Kollár Lajos wrote:

> Dear all,
> 
> I have a question about DOM2 Range Object Model. Shouldn't be
> > void surroundContents(in Node n);
> declared as
> > void surroundContents(in Node n) raises (RangeException); ?

If you look in the section called "Formal Description of the Range 
Interface" you will see that it does indeed raise exceptions, and is 
defined as 

  void               surroundContents(in Node newParent)
                                                                raises(DOMException, 
                                                                       RangeException);

with the description

surroundContents 
                        Reparents the contents of the range to the given 
node and inserts the node at the position of the start of the range. 
                        Parameters 
                           Node 
                                 newParent
                                           The node to surround the contents 
with.

                        Exceptions 
                           DOMException
                                    NO_MODIFICATION_ALLOWED_ERR: 
Raised if an ancestor container of either boundary-point of the 
range is read-only.

                                          WRONG_DOCUMENT_ERR: Raised 
if newParent and the container of the start of the Range were not 
created from the same document.

                                          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 or if newParent is 
an ancestor of the container or if node would end up with a child 
node of a type not allowed by the type of node.

                                          INVALID_STATE_ERR: Raised if 
detach() has already been
                                          invoked on this object.
                           RangeException
                                          BAD_BOUNDARYPOINTS_ERR: 
Raised if the range partially
                                          selects a non-text node.

                                          INVALID_NODE_TYPE_ERR: Raised 
if node is an Attr, Entity, DocumentType, Notation, Document, or 
DocumentFragment node.

regards,

                        No Return Value
Lauren
Received on Monday, 20 December 1999 13:09:38 GMT

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