Bug 1171817 part 4 - Add const version of AsCSSAnimation/AsCSSTransition methods; r=dbaron

These will be needed for sorting animations and transitions in a const-correct
fashion.
This commit is contained in:
Brian Birtles 2015-06-09 11:13:53 +09:00
parent 14ecd51ac3
commit 221b7a5265
4 changed files with 13 additions and 5 deletions

View File

@ -72,7 +72,9 @@ public:
JS::Handle<JSObject*> aGivenProto) override;
virtual CSSAnimation* AsCSSAnimation() { return nullptr; }
virtual const CSSAnimation* AsCSSAnimation() const { return nullptr; }
virtual CSSTransition* AsCSSTransition() { return nullptr; }
virtual const CSSTransition* AsCSSTransition() const { return nullptr; }
/**
* Flag to pass to Play to indicate whether or not it should automatically

View File

@ -211,7 +211,8 @@ public:
JS::Handle<JSObject*> aGivenProto) override;
virtual ElementPropertyTransition* AsTransition() { return nullptr; }
virtual const ElementPropertyTransition* AsTransition() const {
virtual const ElementPropertyTransition* AsTransition() const
{
return nullptr;
}

View File

@ -75,7 +75,8 @@ public:
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
virtual CSSAnimation* AsCSSAnimation() override { return this; }
CSSAnimation* AsCSSAnimation() override { return this; }
const CSSAnimation* AsCSSAnimation() const override { return this; }
// CSSAnimation interface
void GetAnimationName(nsString& aRetVal) const { aRetVal = mAnimationName; }

View File

@ -38,8 +38,11 @@ struct ElementPropertyTransition : public dom::KeyframeEffectReadOnly
: dom::KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType, aTiming)
{ }
virtual ElementPropertyTransition* AsTransition() override { return this; }
virtual const ElementPropertyTransition* AsTransition() const override { return this; }
ElementPropertyTransition* AsTransition() override { return this; }
const ElementPropertyTransition* AsTransition() const override
{
return this;
}
nsCSSProperty TransitionProperty() const {
MOZ_ASSERT(Properties().Length() == 1,
@ -86,7 +89,8 @@ public:
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
virtual CSSTransition* AsCSSTransition() override { return this; }
CSSTransition* AsCSSTransition() override { return this; }
const CSSTransition* AsCSSTransition() const override { return this; }
// CSSTransition interface
void GetTransitionProperty(nsString& aRetVal) const;