Suppose following DOM tree: div0 - div1 - div2 - - div3 - div4 - - div5 In addition, range is of start at (div2,0) and end at (div4, 0).
What will happen when we delete a node div2? http://dom.spec.whatwg.org/#node-is-removed When we are going to delete a node, current spec says cases that a range boundary point is a descendant of the node or a parent of the node. However it is undefined when a boundary point is the node. I guess the case 2 and 3 should be: 2. For each range whose start node is a "inclusive" descendant of node, set its start to (parent, index). 3. For each range whose end node is a "inclusive" descendant of node, set its end to (parent, index).