mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Return the result from match_element rather than using an outparam.
This commit is contained in:
parent
5c7dc4c633
commit
604601f1f4
2 changed files with 10 additions and 11 deletions
|
@ -375,8 +375,8 @@ pub trait ElementMatchMethods {
|
||||||
fn match_element(&self,
|
fn match_element(&self,
|
||||||
stylist: &Stylist,
|
stylist: &Stylist,
|
||||||
parent_bf: Option<&BloomFilter>,
|
parent_bf: Option<&BloomFilter>,
|
||||||
applicable_declarations: &mut ApplicableDeclarations,
|
applicable_declarations: &mut ApplicableDeclarations)
|
||||||
shareable: &mut bool);
|
-> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MatchMethods {
|
pub trait MatchMethods {
|
||||||
|
@ -549,8 +549,8 @@ impl<'ln> ElementMatchMethods for LayoutElement<'ln> {
|
||||||
fn match_element(&self,
|
fn match_element(&self,
|
||||||
stylist: &Stylist,
|
stylist: &Stylist,
|
||||||
parent_bf: Option<&BloomFilter>,
|
parent_bf: Option<&BloomFilter>,
|
||||||
applicable_declarations: &mut ApplicableDeclarations,
|
applicable_declarations: &mut ApplicableDeclarations)
|
||||||
shareable: &mut bool) {
|
-> bool {
|
||||||
let style_attribute = self.style_attribute().as_ref();
|
let style_attribute = self.style_attribute().as_ref();
|
||||||
|
|
||||||
applicable_declarations.normal_shareable =
|
applicable_declarations.normal_shareable =
|
||||||
|
@ -570,7 +570,7 @@ impl<'ln> ElementMatchMethods for LayoutElement<'ln> {
|
||||||
Some(PseudoElement::After),
|
Some(PseudoElement::After),
|
||||||
&mut applicable_declarations.after);
|
&mut applicable_declarations.after);
|
||||||
|
|
||||||
*shareable = applicable_declarations.normal_shareable &&
|
applicable_declarations.normal_shareable &&
|
||||||
applicable_declarations.before.is_empty() &&
|
applicable_declarations.before.is_empty() &&
|
||||||
applicable_declarations.after.is_empty()
|
applicable_declarations.after.is_empty()
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,10 +177,9 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
|
||||||
if let Some(element) = node.as_element() {
|
if let Some(element) = node.as_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,
|
shareable = element.match_element(stylist,
|
||||||
Some(&*bf),
|
Some(&*bf),
|
||||||
&mut applicable_declarations,
|
&mut applicable_declarations);
|
||||||
&mut shareable);
|
|
||||||
} else if node.has_changed() {
|
} else if node.has_changed() {
|
||||||
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
ThreadSafeLayoutNode::new(&node).set_restyle_damage(
|
||||||
incremental::rebuild_and_reflow())
|
incremental::rebuild_and_reflow())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue