Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
Fix #67: ban to insert a node of the Range's start node.
Browse files Browse the repository at this point in the history
Changes in Ranges.
For 'insert a node into a range', if the node to be inserted is
the start node of the range, throw a error.
  • Loading branch information
Yongsheng Zhu authored and yongsheng committed May 17, 2017
1 parent 5fcf455 commit 47f92af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sections/ranges.include
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ interface Range {
much sense, since insertBefore() works fine to move a node to its current
position, and other browsers disagree, so the spec follows the majority.
-->
<li><p>If <var>range</var>'s <a>start node</a> is either a <code><a>ProcessingInstruction</a></code> or <code><a>Comment</a></code> <a>node</a>, or a <code><a>Text</a></code> <a>node</a> whose <a>parent</a> is null, <a>throw</a> an "<code><a>HierarchyRequestError</a></code>". [[!WEBIDL]]
<li><p>If <var>range</var>'s <a>start node</a> is a {{ProcessingInstruction}} or {{Comment}} <a href="#concept-node">node</a>, is a {{Text}} <a href="#concept-node">node</a> whose <a>parent</a> is null,
or is <var>node</var>, then <a>throw</a> an "<code><a>HierarchyRequestError</a></code>".

<!--
Behavior for Text node with null parent:
Expand Down

0 comments on commit 47f92af

Please sign in to comment.