Bug 1679009 - Simplify some getters in CSSPseudoElement and KeyframeEffect. r=hiro

Differential Revision: https://phabricator.services.mozilla.com/D97939
This commit is contained in:
Emilio Cobos Álvarez 2020-11-24 23:58:33 +00:00
parent 472511bebf
commit c3096d1e25
4 changed files with 2 additions and 12 deletions

View File

@ -44,11 +44,6 @@ JSObject* CSSPseudoElement::WrapObject(JSContext* aCx,
return CSSPseudoElement_Binding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<dom::Element> CSSPseudoElement::Element() const {
RefPtr<dom::Element> retVal(mOriginatingElement);
return retVal.forget();
}
/* static */
already_AddRefed<CSSPseudoElement> CSSPseudoElement::GetCSSPseudoElement(
dom::Element* aElement, PseudoStyleType aType) {

View File

@ -47,7 +47,7 @@ class CSSPseudoElement final : public nsWrapperCache {
aRetVal.Append(
nsDependentAtomString(nsCSSPseudoElements::GetPseudoAtom(mPseudoType)));
}
already_AddRefed<dom::Element> Element() const;
dom::Element* Element() const { return mOriginatingElement.get(); }
// Given an element:pseudoType pair, returns the CSSPseudoElement stored as a
// property on |aElement|. If there is no CSSPseudoElement for the specified

View File

@ -1090,11 +1090,6 @@ already_AddRefed<KeyframeEffect> KeyframeEffect::Constructor(
return effect.forget();
}
already_AddRefed<Element> KeyframeEffect::GetTarget() const {
RefPtr<Element> ret = mTarget.mElement;
return ret.forget();
}
void KeyframeEffect::SetPseudoElement(const nsAString& aPseudoElement,
ErrorResult& aRv) {
PseudoStyleType pseudoType = PseudoStyleType::NotPseudo;

View File

@ -142,7 +142,7 @@ class KeyframeEffect : public AnimationEffect {
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv);
already_AddRefed<Element> GetTarget() const;
Element* GetTarget() const { return mTarget.mElement.get(); }
NonOwningAnimationTarget GetAnimationTarget() const {
return NonOwningAnimationTarget(mTarget.mElement, mTarget.mPseudoType);
}