Merge pull request #3051 from metajack/fix-nodeflags-for-layout

Fix the NodeFlags methods that are called by layout.
This commit is contained in:
Patrick Walton 2014-08-08 01:51:22 -07:00
commit cc0b419c20

View file

@ -782,13 +782,13 @@ pub trait RawLayoutNodeHelpers {
impl RawLayoutNodeHelpers for Node { impl RawLayoutNodeHelpers for Node {
unsafe fn get_hover_state_for_layout(&self) -> bool { 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 { 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 { 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> { impl<'a> NodeMethods for JSRef<'a, Node> {