зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1505489 - Don't go through all the part names if not there. r=jwatt
This uses the bit added for tracking part attributes in order to avoid doing wasted work. Depends on D32643 Differential Revision: https://phabricator.services.mozilla.com/D32644 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a0516ce321
Коммит
0d984c302b
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче