From 0d447394b223d0ba57f49814ab0b8262f831ab74 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Thu, 16 Oct 2014 10:56:27 +0900 Subject: [PATCH] Removes Node.unsafe_get_flags(). `Node.unsafe_get_flags()` returns `*const NodeFlags`, but `NodeFlags` has only `u8` length. We should just returns a raw value instead of any pointers. --- components/script/dom/node.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 5b2e3191ce6..57b2ca2a6fb 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -949,15 +949,15 @@ pub trait RawLayoutNodeHelpers { impl RawLayoutNodeHelpers for Node { #[inline] unsafe fn get_hover_state_for_layout(&self) -> bool { - (*self.unsafe_get_flags()).contains(InHoverState) + self.flags.get().contains(InHoverState) } #[inline] unsafe fn get_disabled_state_for_layout(&self) -> bool { - (*self.unsafe_get_flags()).contains(InDisabledState) + self.flags.get().contains(InDisabledState) } #[inline] unsafe fn get_enabled_state_for_layout(&self) -> bool { - (*self.unsafe_get_flags()).contains(InEnabledState) + self.flags.get().contains(InEnabledState) } #[inline] fn type_id_for_layout(&self) -> NodeTypeId { @@ -1612,11 +1612,6 @@ impl Node { } } - #[inline] - pub unsafe fn unsafe_get_flags(&self) -> *const NodeFlags { - mem::transmute(&self.flags) - } - pub fn collect_text_contents<'a, T: Iterator>>(mut iterator: T) -> String { let mut content = String::new(); for node in iterator {