mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove the unused boolean in StyleSharingResult::CannotShare.
This commit is contained in:
parent
f3faaa6b01
commit
843629b29f
2 changed files with 24 additions and 19 deletions
|
@ -363,9 +363,8 @@ impl StyleSharingCandidateCache {
|
||||||
|
|
||||||
/// The results of attempting to share a style.
|
/// The results of attempting to share a style.
|
||||||
pub enum StyleSharingResult {
|
pub enum StyleSharingResult {
|
||||||
/// We didn't find anybody to share the style with. The boolean indicates whether the style
|
/// We didn't find anybody to share the style with.
|
||||||
/// is shareable at all.
|
CannotShare,
|
||||||
CannotShare(bool),
|
|
||||||
/// The node's style can be shared. The integer specifies the index in the LRU cache that was
|
/// The node's style can be shared. The integer specifies the index in the LRU cache that was
|
||||||
/// hit and the damage that was done.
|
/// hit and the damage that was done.
|
||||||
StyleWasShared(usize, RestyleDamage),
|
StyleWasShared(usize, RestyleDamage),
|
||||||
|
@ -581,14 +580,14 @@ impl<'ln> ElementMatchMethods for LayoutElement<'ln> {
|
||||||
parent: Option<LayoutNode>)
|
parent: Option<LayoutNode>)
|
||||||
-> StyleSharingResult {
|
-> StyleSharingResult {
|
||||||
if opts::get().disable_share_style_cache {
|
if opts::get().disable_share_style_cache {
|
||||||
return StyleSharingResult::CannotShare(false)
|
return StyleSharingResult::CannotShare
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.style_attribute().is_some() {
|
if self.style_attribute().is_some() {
|
||||||
return StyleSharingResult::CannotShare(false)
|
return StyleSharingResult::CannotShare
|
||||||
}
|
}
|
||||||
if self.get_attr(&ns!(""), &atom!("id")).is_some() {
|
if self.get_attr(&ns!(""), &atom!("id")).is_some() {
|
||||||
return StyleSharingResult::CannotShare(false)
|
return StyleSharingResult::CannotShare
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
|
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
|
||||||
|
@ -607,7 +606,7 @@ impl<'ln> ElementMatchMethods for LayoutElement<'ln> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleSharingResult::CannotShare(true)
|
StyleSharingResult::CannotShare
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,24 +173,30 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
|
||||||
parent_opt.clone())
|
parent_opt.clone())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => StyleSharingResult::CannotShare(false),
|
None => StyleSharingResult::CannotShare,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Otherwise, match and cascade selectors.
|
// Otherwise, match and cascade selectors.
|
||||||
match sharing_result {
|
match sharing_result {
|
||||||
StyleSharingResult::CannotShare(mut shareable) => {
|
StyleSharingResult::CannotShare => {
|
||||||
let mut applicable_declarations = ApplicableDeclarations::new();
|
let mut applicable_declarations = ApplicableDeclarations::new();
|
||||||
|
|
||||||
if let Some(element) = node.as_element() {
|
let shareable = match node.as_element() {
|
||||||
// Perform the CSS selector matching.
|
Some(element) => {
|
||||||
let stylist = unsafe { &*self.layout_context.shared.stylist };
|
// Perform the CSS selector matching.
|
||||||
shareable = element.match_element(stylist,
|
let stylist = unsafe { &*self.layout_context.shared.stylist };
|
||||||
Some(&*bf),
|
element.match_element(stylist,
|
||||||
&mut applicable_declarations);
|
Some(&*bf),
|
||||||
} else if node.has_changed() {
|
&mut applicable_declarations)
|
||||||
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
},
|
||||||
incremental::rebuild_and_reflow())
|
None => {
|
||||||
}
|
if node.has_changed() {
|
||||||
|
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
||||||
|
incremental::rebuild_and_reflow())
|
||||||
|
}
|
||||||
|
false
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// Perform the CSS cascade.
|
// Perform the CSS cascade.
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue