mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Improve code flow in share_style_if_possible.
This commit is contained in:
parent
50ad1b064d
commit
e5df6fa753
1 changed files with 9 additions and 8 deletions
|
@ -580,15 +580,16 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
||||||
if opts::get().disable_share_style_cache {
|
if opts::get().disable_share_style_cache {
|
||||||
return StyleSharingResult::CannotShare(false)
|
return StyleSharingResult::CannotShare(false)
|
||||||
}
|
}
|
||||||
let ok = {
|
|
||||||
if let Some(element) = self.as_element() {
|
let element = match self.as_element() {
|
||||||
element.style_attribute().is_none() &&
|
Some(element) => element,
|
||||||
element.get_attr(&ns!(""), &atom!("id")).is_none()
|
None => return StyleSharingResult::CannotShare(false),
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
if !ok {
|
|
||||||
|
if element.style_attribute().is_some() {
|
||||||
|
return StyleSharingResult::CannotShare(false)
|
||||||
|
}
|
||||||
|
if element.get_attr(&ns!(""), &atom!("id")).is_some() {
|
||||||
return StyleSharingResult::CannotShare(false)
|
return StyleSharingResult::CannotShare(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue