Fix the NodeFlags methods that are called by layout.

They should never borrow.
This commit is contained in:
Jack Moffitt 2014-08-07 10:30:17 -06:00
parent 1e3dc0341b
commit fedccdb473

View file

@ -782,13 +782,13 @@ pub trait RawLayoutNodeHelpers {
impl RawLayoutNodeHelpers for Node {
unsafe fn get_hover_state_for_layout(&self) -> bool {
self.flags.deref().borrow().contains(InHoverState)
(*self.unsafe_get_flags()).contains(InHoverState)
}
unsafe fn get_disabled_state_for_layout(&self) -> bool {
self.flags.deref().borrow().contains(InDisabledState)
(*self.unsafe_get_flags()).contains(InDisabledState)
}
unsafe fn get_enabled_state_for_layout(&self) -> bool {
self.flags.deref().borrow().contains(InEnabledState)
(*self.unsafe_get_flags()).contains(InEnabledState)
}
}
@ -1414,6 +1414,10 @@ impl Node {
}
}
}
pub unsafe fn unsafe_get_flags(&self) -> *const NodeFlags {
mem::transmute(&self.flags)
}
}
impl<'a> NodeMethods for JSRef<'a, Node> {