Auto merge of #19734 - emilio:less-indirection, r=mbrubeck

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.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19734)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-01-09 23:34:15 -06:00 committed by GitHub
commit e2c89df8ee
5 changed files with 37 additions and 40 deletions

View file

@ -795,7 +795,7 @@ impl Stylist {
pub fn lazily_compute_pseudo_element_style<E>(
&self,
guards: &StylesheetGuards,
element: &E,
element: E,
pseudo: &PseudoElement,
rule_inclusion: RuleInclusion,
parent_style: &ComputedValues,
@ -982,7 +982,7 @@ impl Stylist {
fn lazy_pseudo_rules<E>(
&self,
guards: &StylesheetGuards,
element: &E,
element: E,
parent_style: &ComputedValues,
pseudo: &PseudoElement,
is_probe: bool,
@ -1203,7 +1203,7 @@ impl Stylist {
/// This corresponds to `ElementRuleCollector` in WebKit.
pub fn push_applicable_declarations<E, F>(
&self,
element: &E,
element: E,
pseudo_element: Option<&PseudoElement>,
style_attribute: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>,
smil_override: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>,
@ -1238,7 +1238,7 @@ impl Stylist {
if let Some(map) = self.cascade_data.user_agent.cascade_data.normal_rules(pseudo_element) {
map.get_all_matching_rules(
element,
&rule_hash_target,
rule_hash_target,
applicable_declarations,
context,
self.quirks_mode,
@ -1276,7 +1276,7 @@ impl Stylist {
if let Some(map) = self.cascade_data.user.normal_rules(pseudo_element) {
map.get_all_matching_rules(
element,
&rule_hash_target,
rule_hash_target,
applicable_declarations,
context,
self.quirks_mode,
@ -1307,7 +1307,7 @@ impl Stylist {
if let Some(map) = stylist.cascade_data.author.slotted_rules(pseudo_element) {
map.get_all_matching_rules(
element,
&rule_hash_target,
rule_hash_target,
applicable_declarations,
context,
self.quirks_mode,
@ -1341,7 +1341,7 @@ impl Stylist {
map.get_all_matching_rules(
element,
&rule_hash_target,
rule_hash_target,
applicable_declarations,
&mut matching_context,
stylist.quirks_mode,
@ -1358,7 +1358,7 @@ impl Stylist {
if let Some(map) = self.cascade_data.author.normal_rules(pseudo_element) {
map.get_all_matching_rules(
element,
&rule_hash_target,
rule_hash_target,
applicable_declarations,
context,
self.quirks_mode,