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

Re: [DOM4] reorder the first three steps of pre-insert?

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 23 Dec 2011 17:01:05 -0800
Message-ID: <CABNRm62sJPpaJXBgEFxU7pqqLg+p6QXD7uCD-jfz+b3Vh0pz3w@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: Ryosuke Niwa <rniwa@chromium.org>, Adam Klein <adamk@chromium.org>, www-dom@w3.org
I support this change. Unless there is a known compat. issue we should
proceed with this change.

- Ryosuke
On Dec 23, 2011 1:01 PM, "Ojan Vafai" <ojan@chromium.org> wrote:

>
> http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node-pre-insert
>
> It would somewhat simplify implementation without changing behavior in any
> meaningful way if the first three steps of pre-insert were reversed, i.e.:
>
> 1. If parent is not a Document, DocumentFragment, or Element node, throw a
> "HierarchyRequestError" and terminate these steps.
> 2. If node is parent or an ancestor of parent, throw a
> "HierarchyRequestError" and terminate these steps.
> 3. If child is not null and its parent is not parent, throw a
> "NotFoundError" exception and terminate these steps.
>
> That way the implementation of the insertion methods can always be a
> simple throwing of HierarchyRequestError for any node types other than
> Document/DocumentFragment/Element.
>
> It's not a big deal of course, but all things being equal it's a bit
> simpler. Actually, the order of steps 2 and 3 doesn't matter to me as long
> as step 1 above is first.
>
> Relevant webkit bug: https://bugs.webkit.org/show_bug.cgi?id=75141.
>
Received on Saturday, 24 December 2011 01:01:35 GMT

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