style: Move the check into insert_if_possible.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-14 11:56:45 +02:00
parent 2908c6a266
commit 158aa0ffdf
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 20 additions and 18 deletions

View file

@ -678,14 +678,12 @@ where
resolver.resolve_style_with_default_parents()
};
if !new_styles.primary.0.reused_via_rule_node {
context.thread_local.sharing_cache.insert_if_possible(
&element,
new_styles.primary.style(),
Some(&mut target),
traversal_data.current_dom_depth,
);
}
context.thread_local.sharing_cache.insert_if_possible(
&element,
&new_styles.primary,
Some(&mut target),
traversal_data.current_dom_depth,
);
new_styles
}
@ -725,14 +723,12 @@ where
resolver.cascade_styles_with_default_parents(cascade_inputs)
};
if !new_styles.primary.0.reused_via_rule_node {
context.thread_local.sharing_cache.insert_if_possible(
&element,
new_styles.primary.style(),
None,
traversal_data.current_dom_depth,
);
}
context.thread_local.sharing_cache.insert_if_possible(
&element,
&new_styles.primary,
None,
traversal_data.current_dom_depth,
);
new_styles
}