diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-14 11:56:45 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-14 11:56:45 +0200 |
commit | 158aa0ffdf52255439088526da9963a8dc5c2fe0 (patch) | |
tree | aabc4fa7418c7c4789f03999b379435745613298 /components/style/traversal.rs | |
parent | 2908c6a266aa61535c12f1b332cb5e0985dad88f (diff) | |
download | servo-158aa0ffdf52255439088526da9963a8dc5c2fe0.tar.gz servo-158aa0ffdf52255439088526da9963a8dc5c2fe0.zip |
style: Move the check into insert_if_possible.
Diffstat (limited to 'components/style/traversal.rs')
-rw-r--r-- | components/style/traversal.rs | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/components/style/traversal.rs b/components/style/traversal.rs index a5ddb33749e..20386d754b4 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -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 } |