mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix the NodeFlags methods that are called by layout.
They should never borrow.
This commit is contained in:
parent
1e3dc0341b
commit
fedccdb473
1 changed files with 7 additions and 3 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue