mirror of
https://github.com/servo/servo.git
synced 2025-06-28 02:53:48 +01:00
style: Sprinkle some inline in methods that are just pointer-chasing or function calls.
MozReview-Commit-ID: 8G2NQPBVuXn
This commit is contained in:
parent
4b10b2a7f2
commit
2baa794de6
1 changed files with 7 additions and 0 deletions
|
@ -615,31 +615,37 @@ impl<'le> GeckoElement<'le> {
|
|||
// GeckoNode is a raw reference.
|
||||
//
|
||||
// We can use a Cell<T>, but that's a bit of a pain.
|
||||
#[inline]
|
||||
fn set_flags(&self, flags: u32) {
|
||||
unsafe { Gecko_SetNodeFlags(self.as_node().0, flags) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn unset_flags(&self, flags: u32) {
|
||||
Gecko_UnsetNodeFlags(self.as_node().0, flags)
|
||||
}
|
||||
|
||||
/// Returns true if this element has descendants for lazy frame construction.
|
||||
#[inline]
|
||||
pub fn descendants_need_frames(&self) -> bool {
|
||||
self.flags() & (NODE_DESCENDANTS_NEED_FRAMES as u32) != 0
|
||||
}
|
||||
|
||||
/// Returns true if this element needs lazy frame construction.
|
||||
#[inline]
|
||||
pub fn needs_frame(&self) -> bool {
|
||||
self.flags() & (NODE_NEEDS_FRAME as u32) != 0
|
||||
}
|
||||
|
||||
/// Returns a reference to the DOM slots for this Element, if they exist.
|
||||
#[inline]
|
||||
fn dom_slots(&self) -> Option<&structs::FragmentOrElement_nsDOMSlots> {
|
||||
let slots = self.as_node().0.mSlots as *const structs::FragmentOrElement_nsDOMSlots;
|
||||
unsafe { slots.as_ref() }
|
||||
}
|
||||
|
||||
/// Returns a reference to the extended DOM slots for this Element.
|
||||
#[inline]
|
||||
fn extended_slots(&self) -> Option<&structs::FragmentOrElement_nsExtendedDOMSlots> {
|
||||
self.dom_slots().and_then(|s| unsafe {
|
||||
(s._base.mExtendedSlots.mPtr as *const structs::FragmentOrElement_nsExtendedDOMSlots)
|
||||
|
@ -697,6 +703,7 @@ impl<'le> GeckoElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn non_xul_xbl_binding_parent_raw_content(&self) -> *mut nsIContent {
|
||||
debug_assert!(!self.is_xul_element());
|
||||
self.extended_slots()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue