mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Cleanup NodeIterator, Range, ServoHTMLParser, TextEncoder, URLHelper, URL, VirtualMethods
This commit is contained in:
parent
a53b86f107
commit
19241c95f7
13 changed files with 24 additions and 53 deletions
|
@ -122,7 +122,7 @@ impl Range {
|
|||
return Err(HierarchyRequest);
|
||||
}
|
||||
|
||||
return Ok((first_contained_child, last_contained_child, contained_children));
|
||||
Ok((first_contained_child, last_contained_child, contained_children))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,17 +338,11 @@ impl<'a> RangeMethods for &'a Range {
|
|||
let end = &inner.end;
|
||||
let end_node = end.node();
|
||||
let end_offset = end.offset;
|
||||
match (bp_position(parent.r(), offset + 1, start_node.r(), start_offset).unwrap(),
|
||||
bp_position(parent.r(), offset, end_node.r(), end_offset).unwrap()) {
|
||||
(Ordering::Greater, Ordering::Less) => {
|
||||
// Step 5.
|
||||
true
|
||||
},
|
||||
_ => {
|
||||
// Step 6.
|
||||
false
|
||||
}
|
||||
}
|
||||
// Step 5.
|
||||
Ordering::Greater == bp_position(parent.r(), offset + 1,
|
||||
start_node.r(), start_offset).unwrap() &&
|
||||
Ordering::Less == bp_position(parent.r(), offset,
|
||||
end_node.r(), end_offset).unwrap()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-range-clonecontents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue