diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 05db788db71..bb6f7d0045a 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -84,7 +84,6 @@ use std::cell::RefCell; use std::fmt; use std::hash::{Hash, Hasher}; use std::mem; -use std::ops::DerefMut; use std::ptr; use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace}; use stylist::CascadeData; @@ -615,29 +614,6 @@ impl<'le> GeckoElement<'le> { self.namespace_id() == (structs::root::kNameSpaceID_XUL as i32) } - /// Sets the specified element data, return any existing data. - /// - /// Like `ensure_data`, only safe to call with exclusive access to the - /// element. - pub unsafe fn set_data(&self, replace_data: Option) -> Option { - match (self.get_data(), replace_data) { - (Some(old), Some(replace_data)) => { - Some(mem::replace(old.borrow_mut().deref_mut(), replace_data)) - } - (Some(old), None) => { - let old_data = mem::replace(old.borrow_mut().deref_mut(), ElementData::default()); - self.0.mServoData.set(ptr::null_mut()); - Some(old_data) - } - (None, Some(replace_data)) => { - let ptr = Box::into_raw(Box::new(AtomicRefCell::new(replace_data))); - self.0.mServoData.set(ptr); - None - } - (None, None) => None, - } - } - #[inline] fn has_id(&self) -> bool { self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasID)