diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index e7f790fb1ab..b798d6c1e27 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -715,25 +715,3 @@ impl<'a, T: Reflectable> Reflectable for JSRef<'a, T> { (**self).reflector() } } - -/// A trait for comparing smart pointers ignoring the lifetimes -pub trait Comparable { - /// Returns whether the other value points to the same object. - fn equals(&self, other: T) -> bool; -} - -impl<'a, 'b, T> Comparable> for JSRef<'b, T> { - fn equals(&self, other: JSRef<'a, T>) -> bool { - self.ptr == other.ptr - } -} - -impl<'a, 'b, T> Comparable>> for Option> { - fn equals(&self, other: Option>) -> bool { - match (*self, other) { - (Some(x), Some(y)) => x.ptr == y.ptr, - (None, None) => true, - _ => false - } - } -} diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 85775dbae0e..e72d13295ec 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -15,7 +15,7 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLInp use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLFieldSetElementDerived, EventTargetCast}; use dom::bindings::codegen::InheritTypes::KeyboardEventCast; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{Comparable, JS, JSRef, LayoutJS, MutNullableHeap}; +use dom::bindings::js::{JS, JSRef, LayoutJS, MutNullableHeap}; use dom::bindings::js::{OptionalRootable, ResultRootable, Root, Rootable}; use dom::bindings::js::{RootedReference, Temporary}; use dom::document::{Document, DocumentHelpers}; @@ -371,7 +371,7 @@ fn in_same_group<'a,'b>(other: JSRef<'a, HTMLInputElement>, let other_owner = other_owner.r(); other.input_type.get() == InputType::InputRadio && // TODO Both a and b are in the same home subtree. - other_owner.equals(owner) && + other_owner == owner && // TODO should be a unicode compatibility caseless match match (other.get_radio_group_name(), group) { (Some(ref s1), Some(s2)) => &**s1 == s2,