diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-07-23 20:13:06 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-07-23 20:13:06 +0200 |
commit | 849eb7837a80acfd81fb3840f166ba754ea38b76 (patch) | |
tree | ead659dbb8a986efe0584149d993e127f9418e30 /components/script/dom | |
parent | 32ee62b4c8d66a1630c31f1b7a2e68dd81e7e332 (diff) | |
download | servo-849eb7837a80acfd81fb3840f166ba754ea38b76.tar.gz servo-849eb7837a80acfd81fb3840f166ba754ea38b76.zip |
Move the flag getters to LayoutNodeHelpers.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/node.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 81b2a8bbae4..822d7125623 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1085,6 +1085,11 @@ pub trait LayoutNodeHelpers { unsafe fn layout_data_mut(&self) -> RefMut<Option<LayoutData>>; #[allow(unsafe_code)] unsafe fn layout_data_unchecked(&self) -> *const Option<LayoutData>; + + fn get_hover_state_for_layout(&self) -> bool; + fn get_focus_state_for_layout(&self) -> bool; + fn get_disabled_state_for_layout(&self) -> bool; + fn get_enabled_state_for_layout(&self) -> bool; } impl LayoutNodeHelpers for LayoutJS<Node> { @@ -1174,39 +1179,34 @@ impl LayoutNodeHelpers for LayoutJS<Node> { unsafe fn layout_data_unchecked(&self) -> *const Option<LayoutData> { (*self.unsafe_get()).layout_data.borrow_unchecked() } -} - -pub trait RawLayoutNodeHelpers { - #[allow(unsafe_code)] - unsafe fn get_hover_state_for_layout(&self) -> bool; - #[allow(unsafe_code)] - unsafe fn get_focus_state_for_layout(&self) -> bool; - #[allow(unsafe_code)] - unsafe fn get_disabled_state_for_layout(&self) -> bool; - #[allow(unsafe_code)] - unsafe fn get_enabled_state_for_layout(&self) -> bool; -} -impl RawLayoutNodeHelpers for Node { #[inline] #[allow(unsafe_code)] - unsafe fn get_hover_state_for_layout(&self) -> bool { - self.flags.get().contains(IN_HOVER_STATE) + fn get_hover_state_for_layout(&self) -> bool { + unsafe { + self.get_flag(IN_HOVER_STATE) + } } #[inline] #[allow(unsafe_code)] - unsafe fn get_focus_state_for_layout(&self) -> bool { - self.flags.get().contains(IN_FOCUS_STATE) + fn get_focus_state_for_layout(&self) -> bool { + unsafe { + self.get_flag(IN_FOCUS_STATE) + } } #[inline] #[allow(unsafe_code)] - unsafe fn get_disabled_state_for_layout(&self) -> bool { - self.flags.get().contains(IN_DISABLED_STATE) + fn get_disabled_state_for_layout(&self) -> bool { + unsafe { + self.get_flag(IN_DISABLED_STATE) + } } #[inline] #[allow(unsafe_code)] - unsafe fn get_enabled_state_for_layout(&self) -> bool { - self.flags.get().contains(IN_ENABLED_STATE) + fn get_enabled_state_for_layout(&self) -> bool { + unsafe { + self.get_flag(IN_ENABLED_STATE) + } } } |