| Index: Source/core/dom/Element.cpp | 
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp | 
| index b0623cd8ef5d19427e63b56463fa616af5abee85..dfa59f4f2814ce3975f34f7ea37db485ba2c79ae 100644 | 
| --- a/Source/core/dom/Element.cpp | 
| +++ b/Source/core/dom/Element.cpp | 
| @@ -1718,9 +1718,15 @@ void Element::checkForEmptyStyleChange() | 
|  | 
| if (!style && !styleAffectedByEmpty()) | 
| return; | 
| +    if (styleChangeType() >= SubtreeStyleChange) | 
| +        return; | 
| +    if (!inActiveDocument()) | 
| +        return; | 
| +    if (!document().styleResolver()) | 
| +        return; | 
|  | 
| if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildren()))) | 
| -        setNeedsStyleRecalc(SubtreeStyleChange); | 
| +        document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoEmpty, *this); | 
| } | 
|  | 
| void Element::childrenChanged(const ChildrenChange& change) | 
|  |