Bug 1330190 - Part 3: Add ResolvePseudoElementStyleWithoutAnimation. ?heycam r=heycam

This has the same functionality of ResolveStyleWithoutAnimation() but for pseudo
element instead.

MozReview-Commit-ID: I34lrfqdtuP

--HG--
extra : rebase_source : 5467923c4a4cb06e8999a1116cc2da9b2ed89c5e
This commit is contained in:
Hiroyuki Ikezoe 2017-01-16 16:57:16 +09:00
Родитель 37f87086c5
Коммит 082a3da7a4
2 изменённых файлов: 51 добавлений и 5 удалений

Просмотреть файл

@ -1858,10 +1858,12 @@ nsStyleSet::WalkDisableTextZoomRule(Element* aElement, nsRuleWalker* aRuleWalker
}
already_AddRefed<nsStyleContext>
nsStyleSet::ResolvePseudoElementStyle(Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
Element* aPseudoElement)
nsStyleSet::ResolvePseudoElementStyleInternal(
Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
Element* aPseudoElement,
AnimationFlag aAnimationFlag)
{
NS_ENSURE_FALSE(mInShutdown, nullptr);
@ -1897,7 +1899,9 @@ nsStyleSet::ResolvePseudoElementStyle(Element* aParentElement,
uint32_t flags = eNoFlags;
if (aType == CSSPseudoElementType::before ||
aType == CSSPseudoElementType::after) {
flags |= eDoAnimation;
if (aAnimationFlag == eWithAnimation) {
flags |= eDoAnimation;
}
} else {
// Flex and grid containers don't expect to have any pseudo-element children
// aside from ::before and ::after. So if we have such a child, we're not
@ -1911,6 +1915,33 @@ nsStyleSet::ResolvePseudoElementStyle(Element* aParentElement,
aParentElement, flags);
}
already_AddRefed<nsStyleContext>
nsStyleSet::ResolvePseudoElementStyle(Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
Element* aPseudoElement)
{
return ResolvePseudoElementStyleInternal(aParentElement,
aType,
aParentContext,
aPseudoElement,
eWithAnimation);
}
already_AddRefed<nsStyleContext>
nsStyleSet::ResolvePseudoElementStyleWithoutAnimation(
Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
Element* aPseudoElement)
{
return ResolvePseudoElementStyleInternal(aParentElement,
aType,
aParentContext,
aPseudoElement,
eWithoutAnimation);
}
already_AddRefed<nsStyleContext>
nsStyleSet::ProbePseudoElementStyle(Element* aParentElement,
CSSPseudoElementType aType,

Просмотреть файл

@ -191,6 +191,14 @@ class nsStyleSet final
ResolveStyleWithoutAnimation(mozilla::dom::Element* aTarget,
nsStyleContext* aParentContext);
// Pseudo-element version of the above, ResolveStyleWithoutAnimation.
already_AddRefed<nsStyleContext>
ResolvePseudoElementStyleWithoutAnimation(
mozilla::dom::Element* aParentElement,
mozilla::CSSPseudoElementType aType,
nsStyleContext* aParentContext,
mozilla::dom::Element* aPseudoElement);
// Get a style context for a text node (which no rules will match).
//
// The returned style context will have nsCSSAnonBoxes::mozText as its pseudo.
@ -542,6 +550,13 @@ private:
TreeMatchContext& aTreeMatchContext,
AnimationFlag aAnimationFlag);
already_AddRefed<nsStyleContext>
ResolvePseudoElementStyleInternal(mozilla::dom::Element* aParentElement,
mozilla::CSSPseudoElementType aType,
nsStyleContext* aParentContext,
mozilla::dom::Element* aPseudoElement,
AnimationFlag aAnimationFlag);
nsPresContext* PresContext() { return mRuleTree->PresContext(); }
// The sheets in each array in mSheets are stored with the most significant