diff --git a/components/layout/util.rs b/components/layout/util.rs index a0e466e8875..fd8cb10cd09 100644 --- a/components/layout/util.rs +++ b/components/layout/util.rs @@ -77,20 +77,20 @@ pub trait LayoutDataAccess { impl<'ln> LayoutDataAccess for LayoutNode<'ln> { #[inline(always)] unsafe fn borrow_layout_data_unchecked(&self) -> *const Option { - mem::transmute(self.get().layout_data.borrow_unchecked()) + mem::transmute(self.get().layout_data.deref().borrow_unchecked()) } #[inline(always)] fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option> { unsafe { - mem::transmute(self.get().layout_data.borrow()) + mem::transmute(self.get().layout_data.deref().borrow()) } } #[inline(always)] fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option> { unsafe { - mem::transmute(self.get().layout_data.borrow_mut()) + mem::transmute(self.get().layout_data.deref().borrow_mut()) } } } diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 8b360452122..36bebcaf760 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -646,7 +646,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { #[inline(always)] pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option> { unsafe { - mem::transmute(self.get().layout_data.borrow()) + mem::transmute(self.get().layout_data.deref().borrow()) } } @@ -654,7 +654,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { #[inline(always)] pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option> { unsafe { - mem::transmute(self.get().layout_data.borrow_mut()) + mem::transmute(self.get().layout_data.deref().borrow_mut()) } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index bafce1aaf25..db8c7456b28 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -24,7 +24,7 @@ use dom::bindings::global::{GlobalRef, Window}; use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root, OptionalUnrootable}; use dom::bindings::js::{OptionalSettable, TemporaryPushable, OptionalRootedRootable}; use dom::bindings::js::{ResultRootable, OptionalRootable}; -use dom::bindings::trace::Traceable; +use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::utils; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::characterdata::CharacterData; @@ -108,7 +108,7 @@ pub struct Node { /// /// Must be sent back to the layout task to be destroyed when this /// node is finalized. - pub layout_data: LayoutDataRef, + pub layout_data: Untraceable, unique_id: RefCell, } @@ -1041,7 +1041,7 @@ impl Node { flags: Traceable::new(RefCell::new(NodeFlags::new(type_id))), - layout_data: LayoutDataRef::new(), + layout_data: Untraceable::new(LayoutDataRef::new()), unique_id: RefCell::new("".to_string()), } @@ -1454,7 +1454,7 @@ impl Node { /// Sends layout data, if any, back to the layout task to be destroyed. unsafe fn reap_layout_data(&mut self) { if self.layout_data.is_present() { - let layout_data = mem::replace(&mut self.layout_data, LayoutDataRef::new()); + let layout_data = mem::replace(self.layout_data.deref_mut(), LayoutDataRef::new()); let layout_chan = layout_data.take_chan(); match layout_chan { None => {}