mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Do not panic on navigating across documents
This commit is contained in:
parent
da45522085
commit
962e620529
3 changed files with 12 additions and 8 deletions
|
@ -708,16 +708,16 @@ impl Node {
|
|||
&self,
|
||||
other: &Node,
|
||||
shadow_including: ShadowIncluding,
|
||||
) -> DomRoot<Node> {
|
||||
) -> Option<DomRoot<Node>> {
|
||||
for ancestor in self.inclusive_ancestors(shadow_including) {
|
||||
if other
|
||||
.inclusive_ancestors(shadow_including)
|
||||
.any(|node| node == ancestor)
|
||||
{
|
||||
return ancestor;
|
||||
return Some(ancestor);
|
||||
}
|
||||
}
|
||||
unreachable!();
|
||||
None
|
||||
}
|
||||
|
||||
pub fn is_inclusive_ancestor_of(&self, parent: &Node) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue