auto merge of #3694 : saneyuki/servo/node, r=jdm

`Node.unsafe_get_flags()` returns `*const NodeFlags`, but `NodeFlags` has only `u8` length.
So We should just returns a raw value instead of any pointers.
This commit is contained in:
bors-servo 2014-10-15 22:45:19 -06:00
commit 84b2fe54b9

View file

@ -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<JSRef<'a, Node>>>(mut iterator: T) -> String {
let mut content = String::new();
for node in iterator {