mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Remove the boolean shareable flag in RecalcStyleForNode::process.
This commit is contained in:
parent
843629b29f
commit
2bfca9cace
1 changed files with 11 additions and 9 deletions
|
@ -181,20 +181,24 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
|
||||||
StyleSharingResult::CannotShare => {
|
StyleSharingResult::CannotShare => {
|
||||||
let mut applicable_declarations = ApplicableDeclarations::new();
|
let mut applicable_declarations = ApplicableDeclarations::new();
|
||||||
|
|
||||||
let shareable = match node.as_element() {
|
let shareable_element = match node.as_element() {
|
||||||
Some(element) => {
|
Some(element) => {
|
||||||
// Perform the CSS selector matching.
|
// Perform the CSS selector matching.
|
||||||
let stylist = unsafe { &*self.layout_context.shared.stylist };
|
let stylist = unsafe { &*self.layout_context.shared.stylist };
|
||||||
element.match_element(stylist,
|
if element.match_element(stylist,
|
||||||
Some(&*bf),
|
Some(&*bf),
|
||||||
&mut applicable_declarations)
|
&mut applicable_declarations) {
|
||||||
|
Some(element)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
if node.has_changed() {
|
if node.has_changed() {
|
||||||
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
||||||
incremental::rebuild_and_reflow())
|
incremental::rebuild_and_reflow())
|
||||||
}
|
}
|
||||||
false
|
None
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -208,10 +212,8 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add ourselves to the LRU cache.
|
// Add ourselves to the LRU cache.
|
||||||
if shareable {
|
if let Some(element) = shareable_element {
|
||||||
if let Some(element) = node.as_element() {
|
style_sharing_candidate_cache.insert_if_possible(&element);
|
||||||
style_sharing_candidate_cache.insert_if_possible(&element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StyleSharingResult::StyleWasShared(index, damage) => {
|
StyleSharingResult::StyleWasShared(index, damage) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue