mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
style: Remove some unneeded indirection.
All TElement's implement Copy, and are just pointers, so the double indirection is stupid. I'm going to try to see if removing this double-indirection fixes some selector-matching performance, and this is a trivial pre-requisite while I wait for Talos results.
This commit is contained in:
parent
bfc91c5e12
commit
8f6455b9df
5 changed files with 37 additions and 40 deletions
|
@ -398,22 +398,20 @@ pub trait ThreadSafeLayoutElement
|
|||
&style_pseudo,
|
||||
Some(data.styles.primary()),
|
||||
CascadeFlags::empty(),
|
||||
&ServoMetricsProvider)
|
||||
.clone()
|
||||
&ServoMetricsProvider,
|
||||
)
|
||||
}
|
||||
PseudoElementCascadeType::Lazy => {
|
||||
context.stylist
|
||||
.lazily_compute_pseudo_element_style(
|
||||
&context.guards,
|
||||
unsafe { &self.unsafe_get() },
|
||||
&style_pseudo,
|
||||
RuleInclusion::All,
|
||||
data.styles.primary(),
|
||||
/* is_probe = */ false,
|
||||
&ServoMetricsProvider,
|
||||
/* matching_func = */ None)
|
||||
.unwrap()
|
||||
.clone()
|
||||
context.stylist.lazily_compute_pseudo_element_style(
|
||||
&context.guards,
|
||||
unsafe { self.unsafe_get() },
|
||||
&style_pseudo,
|
||||
RuleInclusion::All,
|
||||
data.styles.primary(),
|
||||
/* is_probe = */ false,
|
||||
&ServoMetricsProvider,
|
||||
/* matching_func = */ None,
|
||||
).unwrap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +422,7 @@ pub trait ThreadSafeLayoutElement
|
|||
fn selected_style(&self) -> Arc<ComputedValues> {
|
||||
let data = self.style_data();
|
||||
data.styles.pseudos
|
||||
.get(&PseudoElement::Selection).map(|s| s)
|
||||
.get(&PseudoElement::Selection)
|
||||
.unwrap_or(data.styles.primary())
|
||||
.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue