mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
script: Inline is_element_for_layout
and friends.
8% improvement on style recalc on Wikipedia.
This commit is contained in:
parent
f359bc9337
commit
7350cfb004
1 changed files with 3 additions and 0 deletions
|
@ -659,10 +659,12 @@ pub trait LayoutNodeHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LayoutNodeHelpers for JS<Node> {
|
impl LayoutNodeHelpers for JS<Node> {
|
||||||
|
#[inline]
|
||||||
unsafe fn type_id_for_layout(&self) -> NodeTypeId {
|
unsafe fn type_id_for_layout(&self) -> NodeTypeId {
|
||||||
(*self.unsafe_get()).type_id
|
(*self.unsafe_get()).type_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
unsafe fn is_element_for_layout(&self) -> bool {
|
unsafe fn is_element_for_layout(&self) -> bool {
|
||||||
(*self.unsafe_get()).is_element()
|
(*self.unsafe_get()).is_element()
|
||||||
}
|
}
|
||||||
|
@ -692,6 +694,7 @@ impl LayoutNodeHelpers for JS<Node> {
|
||||||
(*self.unsafe_get()).next_sibling.get()
|
(*self.unsafe_get()).next_sibling.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
unsafe fn owner_doc_for_layout(&self) -> JS<Document> {
|
unsafe fn owner_doc_for_layout(&self) -> JS<Document> {
|
||||||
(*self.unsafe_get()).owner_doc.get().unwrap()
|
(*self.unsafe_get()).owner_doc.get().unwrap()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue