mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
commit
84b2fe54b9
1 changed files with 3 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue