mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Fix step 1 of Range::InsertNode
The method needs to throw when trying to insert start node into range.
This commit is contained in:
parent
be6940db59
commit
c713734b48
3 changed files with 3 additions and 142 deletions
|
@ -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) => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue