W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2014

Re: Query on DOM range methods

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 7 Feb 2014 10:33:53 +0100
Message-ID: <CADnb78jjfyqkx+wbNrT8O6h_0DjkQ-=LBHDRXqtjm8EZio_sig@mail.gmail.com>
To: bhanukrushna rout <bhanu_nitrkl12@yahoo.co.in>
Cc: Aryeh Gregor <ayg@aryeh.name>, "www-dom@w3.org" <www-dom@w3.org>
On Fri, Feb 7, 2014 at 7:37 AM, bhanukrushna rout
<bhanu_nitrkl12@yahoo.co.in> wrote:
> Yes, this is one of the 2 queries I wanted an answer i.e the expected
> behaviour when element node is a root container. But, I don't see this
> behaviour called out anywhere in any version of the specs.

If it's not explicitly forbidden, it should work. Ranges on
disconnected trees of elements seem fine. Why should they not work?

> The other query I had, are the constraints for range methods  specified in
> DOM2 still valid along with new behaviour specified in DOM4.
> For ex:
> setStartBefore in DOM2 :
>     Sets the start position to be before a node
>     Parameters
>         refNode of type Node
>         Range starts before refNode
>     Exceptions
>         RangeException
>             INVALID_NODE_TYPE_ERR: Raised if the root container of refNode
> is not an Attr, Document, or DocumentFragment node or if refNode is a
> Document, DocumentFragment, Attr, Entity, or Notation node.

Well, Attr, Entity, and Notation no longer exist.

We already established the root can be an element in the disconnected
element case as per my example. If refNode is a Document or
DocumentFragment that would indeed fail per the definition in
http://dom.spec.whatwg.org/#dom-range-setstartbefore as parent would
be null.

> I hope, DOM2 spec is not deprecated one, the behaviour is still valid.

No, it's obsolete.See http://dom.spec.whatwg.org/#goals

Received on Friday, 7 February 2014 09:34:20 UTC

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