- From: Ojan Vafai <ojan@chromium.org>
- Date: Fri, 23 Dec 2011 15:59:24 -0500
- To: www-dom@w3.org, Ryosuke Niwa <rniwa@chromium.org>, Adam Klein <adamk@chromium.org>
Received on Friday, 23 December 2011 21:00:21 UTC
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 Friday, 23 December 2011 21:00:21 UTC