mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
parent
801b939479
commit
a07a0cf39f
3 changed files with 7 additions and 7 deletions
|
@ -727,7 +727,7 @@ impl<'a, T> Clone for JSRef<'a, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> PartialEq for JSRef<'a, T> {
|
impl<'a, 'b, T> PartialEq<JSRef<'b, T>> for JSRef<'a, T> {
|
||||||
fn eq(&self, other: &JSRef<T>) -> bool {
|
fn eq(&self, other: &JSRef<T>) -> bool {
|
||||||
self.ptr == other.ptr
|
self.ptr == other.ptr
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
||||||
let browser_context = browser_context.as_ref().unwrap();
|
let browser_context = browser_context.as_ref().unwrap();
|
||||||
let active_document = browser_context.active_document().root();
|
let active_document = browser_context.active_document().root();
|
||||||
|
|
||||||
if self.clone() != active_document.r() {
|
if self != active_document.r() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// FIXME: It should also check whether the browser context is top-level or not
|
// FIXME: It should also check whether the browser context is top-level or not
|
||||||
|
|
|
@ -409,7 +409,7 @@ pub trait NodeHelpers<'a> {
|
||||||
fn child_elements(self) -> ChildElementIterator<'a>;
|
fn child_elements(self) -> ChildElementIterator<'a>;
|
||||||
fn following_siblings(self) -> NodeChildrenIterator<'a>;
|
fn following_siblings(self) -> NodeChildrenIterator<'a>;
|
||||||
fn is_in_doc(self) -> bool;
|
fn is_in_doc(self) -> bool;
|
||||||
fn is_inclusive_ancestor_of(self, parent: JSRef<'a, Node>) -> bool; // FIXME: See #3960
|
fn is_inclusive_ancestor_of(self, parent: JSRef<Node>) -> bool;
|
||||||
fn is_parent_of(self, child: JSRef<Node>) -> bool;
|
fn is_parent_of(self, child: JSRef<Node>) -> bool;
|
||||||
|
|
||||||
fn type_id(self) -> NodeTypeId;
|
fn type_id(self) -> NodeTypeId;
|
||||||
|
@ -715,7 +715,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_inclusive_ancestor_of(self, parent: JSRef<'a, Node>) -> bool {
|
fn is_inclusive_ancestor_of(self, parent: JSRef<Node>) -> bool {
|
||||||
self == parent || parent.ancestors().any(|ancestor| ancestor == self)
|
self == parent || parent.ancestors().any(|ancestor| ancestor == self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1376,7 +1376,7 @@ impl Node {
|
||||||
|
|
||||||
// Step 7-8.
|
// Step 7-8.
|
||||||
let reference_child = match child {
|
let reference_child = match child {
|
||||||
Some(child) if child.clone() == node => node.next_sibling().map(|node| node.root().get_unsound_ref_forever()),
|
Some(child) if child == node => node.next_sibling().map(|node| node.root().get_unsound_ref_forever()),
|
||||||
_ => child
|
_ => child
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1946,7 +1946,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ok if not caught by previous error checks.
|
// Ok if not caught by previous error checks.
|
||||||
if node.clone() == child {
|
if node == child {
|
||||||
return Ok(Temporary::from_rooted(child));
|
return Ok(Temporary::from_rooted(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2106,7 +2106,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
|
// http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
|
||||||
fn CompareDocumentPosition(self, other: JSRef<Node>) -> u16 {
|
fn CompareDocumentPosition(self, other: JSRef<Node>) -> u16 {
|
||||||
if self.clone() == other { // FIXME: See issue #3960
|
if self == other {
|
||||||
// step 2.
|
// step 2.
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue