Fix step 1 of Range::InsertNode

The method needs to throw when trying to insert start node into range.
This commit is contained in:
Anthony Ramine 2016-02-28 20:26:02 +01:00
parent be6940db59
commit c713734b48
3 changed files with 3 additions and 142 deletions

View file

@ -658,6 +658,9 @@ impl RangeMethods for Range {
let start_offset = self.StartOffset();
// Step 1.
if &*start_node == node {
return Err(Error::HierarchyRequest);
}
match start_node.type_id() {
// Handled under step 2.
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => (),