diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index e3d7f0a294a..5bd1406c27a 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -275,14 +275,6 @@ impl<'ln> TNode<'ln> for ServoLayoutNode<'ln> { self.node.next_sibling_ref().map(|node| self.new_with_this_lifetime(&node)) } } - - fn style(&self) -> Ref> { - Ref::map(self.borrow_data().unwrap(), |data| data.style.as_ref().unwrap()) - } - - fn unstyle(self) { - self.mutate_data().unwrap().style = None; - } } impl<'ln> LayoutNode<'ln> for ServoLayoutNode<'ln> { diff --git a/components/style/dom.rs b/components/style/dom.rs index f85484e0c70..25656b22e5c 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -160,10 +160,14 @@ pub trait TNode<'ln> : Sized + Copy + Clone { /// Returns the style results for the given node. If CSS selector matching /// has not yet been performed, fails. - fn style(&self) -> Ref>; + fn style(&self) -> Ref> { + Ref::map(self.borrow_data().unwrap(), |data| data.style.as_ref().unwrap()) + } /// Removes the style from this node. - fn unstyle(self); + fn unstyle(self) { + self.mutate_data().unwrap().style = None; + } } pub trait TDocument<'ld> : Sized + Copy + Clone { diff --git a/components/style/lib.rs b/components/style/lib.rs index 7fd0b5b132c..18e84d5729e 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -4,6 +4,7 @@ #![feature(box_syntax)] #![feature(box_patterns)] +#![feature(cell_extras)] #![feature(concat_idents)] #![feature(core_intrinsics)] #![feature(custom_attribute)]