diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 01ed3bd722e..4a63665a073 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -390,7 +390,7 @@ pub struct LayoutElement<'le> { impl<'le> LayoutElement<'le> { pub fn style_attribute(&self) -> &'le Option { let style: &Option = unsafe { - let style: &RefCell> = self.element.style_attribute.deref(); + let style: &RefCell> = &self.element.style_attribute; // cast to the direct reference to T placed on the head of RefCell mem::transmute(style) }; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 324cb02b2a7..a3960116ab2 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -14,7 +14,6 @@ use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods; use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast}; use dom::bindings::js::{MutNullableJS, JS, JSRef, Temporary, TemporaryPushable}; use dom::bindings::js::{OptionalSettable, OptionalRootable, Root}; -use dom::bindings::trace::Traceable; use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter, Syntax}; use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type}; @@ -51,7 +50,7 @@ pub struct Element { pub namespace: Namespace, pub prefix: Option, pub attrs: RefCell>>, - pub style_attribute: Traceable>>, + pub style_attribute: RefCell>, pub attr_list: MutNullableJS, class_list: MutNullableJS, } @@ -159,7 +158,7 @@ impl Element { attrs: RefCell::new(vec!()), attr_list: Default::default(), class_list: Default::default(), - style_attribute: Traceable::new(RefCell::new(None)), + style_attribute: RefCell::new(None), } } @@ -851,7 +850,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> { let doc = document_from_node(*self).root(); let base_url = doc.deref().url().clone(); let style = Some(style::parse_style_attribute(value.as_slice(), &base_url)); - *self.deref().style_attribute.deref().borrow_mut() = style; + *self.deref().style_attribute.borrow_mut() = style; } "id" => { let node: JSRef = NodeCast::from_ref(*self); @@ -875,7 +874,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> { match name.as_slice() { "style" => { - *self.deref().style_attribute.deref().borrow_mut() = None; + *self.deref().style_attribute.borrow_mut() = None; } "id" => { let node: JSRef = NodeCast::from_ref(*self);