diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index b46f127253b..3161d3754c9 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -2339,6 +2339,12 @@ impl IDLInterface for %(name)s { %(check)s } } + +impl PartialEq for %(name)s { + fn eq(&self, other: &%(name)s) -> bool { + self as *const %(name)s == &*other + } +} """ % {'check': check, 'name': name} diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index f2593121c6c..b3d747fc4d9 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -208,12 +208,6 @@ pub struct Document { css_errors_store: DOMRefCell>, } -impl PartialEq for Document { - fn eq(&self, other: &Document) -> bool { - self as *const Document == &*other - } -} - #[derive(JSTraceable, HeapSizeOf)] struct ImagesFilter; impl CollectionFilter for ImagesFilter { diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index e65904d615a..360623f3df9 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -104,12 +104,6 @@ pub struct Element { state: Cell, } -impl PartialEq for Element { - fn eq(&self, other: &Element) -> bool { - self as *const Element == &*other - } -} - #[derive(PartialEq, HeapSizeOf)] pub enum ElementCreator { ParserCreated, diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index cad4fcec951..b8d26b5ad3d 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -53,12 +53,6 @@ pub struct HTMLCanvasElement { context: DOMRefCell>, } -impl PartialEq for HTMLCanvasElement { - fn eq(&self, other: &HTMLCanvasElement) -> bool { - self as *const HTMLCanvasElement == &*other - } -} - impl HTMLCanvasElement { fn new_inherited(localName: Atom, prefix: Option, diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 8d4d0c5f457..d0f3f35d0ab 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -46,12 +46,6 @@ pub struct HTMLElement { dataset: MutNullableHeap>, } -impl PartialEq for HTMLElement { - fn eq(&self, other: &HTMLElement) -> bool { - self as *const HTMLElement == &*other - } -} - impl HTMLElement { pub fn new_inherited(tag_name: Atom, prefix: Option, document: &Document) -> HTMLElement { diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 536b1e46c73..bb3e4a6bc2f 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -45,12 +45,6 @@ pub struct HTMLFormElement { marked_for_reset: Cell, } -impl PartialEq for HTMLFormElement { - fn eq(&self, other: &HTMLFormElement) -> bool { - self as *const HTMLFormElement == &*other - } -} - impl HTMLFormElement { fn new_inherited(localName: Atom, prefix: Option, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index c94be647354..5dd4309cc98 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -73,12 +73,6 @@ pub struct HTMLInputElement { activation_state: DOMRefCell, } -impl PartialEq for HTMLInputElement { - fn eq(&self, other: &HTMLInputElement) -> bool { - self as *const HTMLInputElement == &*other - } -} - #[derive(JSTraceable)] #[must_root] #[derive(HeapSizeOf)] diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 021d595fbf8..76b858cf92d 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -122,12 +122,6 @@ pub struct Node { unique_id: DOMRefCell>>, } -impl PartialEq for Node { - fn eq(&self, other: &Node) -> bool { - self as *const Node == &*other - } -} - bitflags! { #[doc = "Flags for node items."] #[derive(JSTraceable, HeapSizeOf)]