Skip to content

Commit

Permalink
Remove Traceable from element.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Oct 5, 2014
1 parent 4f362ab commit 96f6c2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/layout/wrapper.rs
Expand Up @@ -390,7 +390,7 @@ pub struct LayoutElement<'le> {
impl<'le> LayoutElement<'le> {
pub fn style_attribute(&self) -> &'le Option<PropertyDeclarationBlock> {
let style: &Option<PropertyDeclarationBlock> = unsafe {
let style: &RefCell<Option<PropertyDeclarationBlock>> = self.element.style_attribute.deref();
let style: &RefCell<Option<PropertyDeclarationBlock>> = &self.element.style_attribute;
// cast to the direct reference to T placed on the head of RefCell<T>
mem::transmute(style)
};
Expand Down
9 changes: 4 additions & 5 deletions components/script/dom/element.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -51,7 +50,7 @@ pub struct Element {
pub namespace: Namespace,
pub prefix: Option<DOMString>,
pub attrs: RefCell<Vec<JS<Attr>>>,
pub style_attribute: Traceable<RefCell<Option<style::PropertyDeclarationBlock>>>,
pub style_attribute: RefCell<Option<style::PropertyDeclarationBlock>>,
pub attr_list: MutNullableJS<NamedNodeMap>,
class_list: MutNullableJS<DOMTokenList>,
}
Expand Down Expand Up @@ -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),
}
}

Expand Down Expand Up @@ -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<Node> = NodeCast::from_ref(*self);
Expand All @@ -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<Node> = NodeCast::from_ref(*self);
Expand Down

0 comments on commit 96f6c2f

Please sign in to comment.