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

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 UTC