Bug 1401317 - Disable lazy pseudo caching when the originating element's primary style was reused via the rule node. r=emilio
MozReview-Commit-ID: IkBa39E1bR1
This commit is contained in:
@@ -548,6 +548,16 @@ ServoStyleSet::ResolveStyleForPlaceholder()
|
||||
return computedValues.forget();
|
||||
}
|
||||
|
||||
static inline bool
|
||||
LazyPseudoIsCacheable(CSSPseudoElementType aType,
|
||||
Element* aOriginatingElement,
|
||||
ServoStyleContext* aParentContext)
|
||||
{
|
||||
return aParentContext &&
|
||||
!nsCSSPseudoElements::IsEagerlyCascadedInServo(aType) &&
|
||||
!Servo_Element_IsPrimaryStyleReusedViaRuleNode(aOriginatingElement);
|
||||
}
|
||||
|
||||
already_AddRefed<ServoStyleContext>
|
||||
ServoStyleSet::ResolvePseudoElementStyle(Element* aOriginatingElement,
|
||||
CSSPseudoElementType aType,
|
||||
@@ -566,7 +576,7 @@ ServoStyleSet::ResolvePseudoElementStyle(Element* aOriginatingElement,
|
||||
Servo_ResolveStyle(aPseudoElement, mRawSet.get()).Consume();
|
||||
} else {
|
||||
bool cacheable =
|
||||
!nsCSSPseudoElements::IsEagerlyCascadedInServo(aType) && aParentContext;
|
||||
LazyPseudoIsCacheable(aType, aOriginatingElement, aParentContext);
|
||||
computedValues =
|
||||
cacheable ? aParentContext->GetCachedLazyPseudoStyle(aType) : nullptr;
|
||||
|
||||
@@ -895,7 +905,7 @@ ServoStyleSet::ProbePseudoElementStyle(Element* aOriginatingElement,
|
||||
MOZ_ASSERT(aType < CSSPseudoElementType::Count);
|
||||
|
||||
bool cacheable =
|
||||
!nsCSSPseudoElements::IsEagerlyCascadedInServo(aType) && aParentContext;
|
||||
LazyPseudoIsCacheable(aType, aOriginatingElement, aParentContext);
|
||||
|
||||
RefPtr<ServoStyleContext> computedValues =
|
||||
cacheable ? aParentContext->GetCachedLazyPseudoStyle(aType) : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user