From 88c69206ebb2e98965a7571f9788f81c10b512b9 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:27:50 +0900 Subject: [PATCH] Do not call get_animation_rules for pseudo elements other than ::before and ::after. --- components/style/matching.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/style/matching.rs b/components/style/matching.rs index 619e1d57f7a..296862cfe20 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -14,7 +14,7 @@ use cache::{LRUCache, LRUCacheMutIterator}; use cascade_info::CascadeInfo; use context::{SequentialTask, SharedStyleContext, StyleContext}; use data::{ComputedStyle, ElementData, ElementStyles, RestyleData}; -use dom::{SendElement, TElement, TNode}; +use dom::{AnimationRules, SendElement, TElement, TNode}; use properties::{CascadeFlags, ComputedValues, SHAREABLE, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade}; use properties::longhands::display::computed_value as display; use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RestyleHint}; @@ -800,7 +800,11 @@ pub trait MatchMethods : TElement { SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| { let mut per_pseudo = &mut data.styles_mut().pseudos; debug_assert!(applicable_declarations.is_empty()); - let pseudo_animation_rules = self.get_animation_rules(Some(&pseudo)); + let pseudo_animation_rules = if ::Impl::pseudo_is_before_or_after(&pseudo) { + self.get_animation_rules(Some(&pseudo)) + } else { + AnimationRules(None, None) + }; stylist.push_applicable_declarations(self, Some(context.thread_local.bloom_filter.filter()), None, pseudo_animation_rules,