This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28061 - Description of before/after/replace only mentions single node
Summary: Description of before/after/replace only mentions single node
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 05:24 UTC by Josh Matthews
Modified: 2015-05-08 09:13 UTC (History)
2 users (show)

See Also:


Attachments

Description Josh Matthews 2015-02-20 05:24:23 UTC
https://dom.spec.whatwg.org/#interface-childnode

[[
The before(nodes) method must run these steps:

    If the context object does not have a parent, terminate these steps.
    Run the mutation method macro.

    Pre-insert node into the context object's parent before the context object. 

The after(nodes) method must run these steps:

    If the context object does not have a parent, terminate these steps.
    Run the mutation method macro.

    Pre-insert node into the context object's parent before the context object's next sibling. 

The replaceWith(nodes) method must run these steps:

    If the context object does not have a parent, terminate these steps.
    Run the mutation method macro.

    Replace the context object with node within the context object's parent. 
]]

These steps only refer to a single node, not the collection of nodes and/or DOMString values that can be passed to each method.
Comment 1 Anne 2015-02-20 06:54:28 UTC
Josh, the mutation method macro takes care of that, no? Having said that, these methods need some fixes to their algorithms. In particular when passed the context object.
Comment 2 Josh Matthews 2015-02-20 08:40:01 UTC
Oh, my mistake; I skimmed over step 2 every time while reading it.
Comment 3 Anne 2015-05-08 09:13:24 UTC
See https://github.com/whatwg/dom/issues/32 for some work that is needed here.