mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1226118 part 1 - Add EffectSet::GetEffectSet(const nsIFrame*); r=dholbert
This commit is contained in:
parent
8a2568e4ac
commit
1525268b3d
@ -41,6 +41,42 @@ EffectSet::GetEffectSet(dom::Element* aElement,
|
||||
return static_cast<EffectSet*>(aElement->GetProperty(propName));
|
||||
}
|
||||
|
||||
/* static */ EffectSet*
|
||||
EffectSet::GetEffectSet(const nsIFrame* aFrame)
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (!content) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIAtom* propName;
|
||||
if (aFrame->IsGeneratedContentFrame()) {
|
||||
nsIFrame* parent = aFrame->GetParent();
|
||||
if (parent->IsGeneratedContentFrame()) {
|
||||
return nullptr;
|
||||
}
|
||||
nsIAtom* name = content->NodeInfo()->NameAtom();
|
||||
if (name == nsGkAtoms::mozgeneratedcontentbefore) {
|
||||
propName = nsGkAtoms::animationEffectsForBeforeProperty;
|
||||
} else if (name == nsGkAtoms::mozgeneratedcontentafter) {
|
||||
propName = nsGkAtoms::animationEffectsForAfterProperty;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
content = content->GetParent();
|
||||
if (!content) {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
if (!content->MayHaveAnimations()) {
|
||||
return nullptr;
|
||||
}
|
||||
propName = nsGkAtoms::animationEffectsProperty;
|
||||
}
|
||||
|
||||
return static_cast<EffectSet*>(content->GetProperty(propName));
|
||||
}
|
||||
|
||||
/* static */ EffectSet*
|
||||
EffectSet::GetOrCreateEffectSet(dom::Element* aElement,
|
||||
nsCSSPseudoElements::Type aPseudoType)
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
|
||||
static EffectSet* GetEffectSet(dom::Element* aElement,
|
||||
nsCSSPseudoElements::Type aPseudoType);
|
||||
static EffectSet* GetEffectSet(const nsIFrame* aFrame);
|
||||
static EffectSet* GetOrCreateEffectSet(dom::Element* aElement,
|
||||
nsCSSPseudoElements::Type aPseudoType);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user