mirror of
https://github.com/servo/servo.git
synced 2025-06-28 02:53:48 +01:00
style: Don't go through all the part names if not there.
This uses the bit added for tracking part attributes in order to avoid doing wasted work. Differential Revision: https://phabricator.services.mozilla.com/D32644
This commit is contained in:
parent
f0bf7d6481
commit
96594be65d
1 changed files with 8 additions and 0 deletions
|
@ -590,6 +590,9 @@ impl<'le> GeckoElement<'le> {
|
|||
|
||||
#[inline(always)]
|
||||
fn get_part_attr(&self) -> Option<&structs::nsAttrValue> {
|
||||
if !self.has_part_attr() {
|
||||
return None;
|
||||
}
|
||||
snapshot_helpers::find_attr(self.attrs(), &atom!("part"))
|
||||
}
|
||||
|
||||
|
@ -623,6 +626,11 @@ impl<'le> GeckoElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn has_part_attr(&self) -> bool {
|
||||
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasPart)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn may_have_anonymous_children(&self) -> bool {
|
||||
self.as_node()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue