Bug 1302648 part 3 - Change order of releasing owning element when cancel animation. r=birtles

The first step of Animation::Cancel(), it will release owning element.
However we will use owning element for queueing the CSS-Animations event, So we will need to release owning element after calling Animation::Cancel() in order to fire the animationcancel event.

MozReview-Commit-ID: ATqkIGkqREx

--HG--
extra : rebase_source : 9b04dc59349d1203d5f8604516fcc6765cf3d5a7
This commit is contained in:
Mantaroh Yoshinaga 2017-02-10 12:32:44 +09:00
Родитель d5e9a6bfe7
Коммит 2658cfcde7
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -110,7 +110,6 @@ public:
void PauseFromStyle(); void PauseFromStyle();
void CancelFromStyle() override void CancelFromStyle() override
{ {
mOwningElement = OwningElementRef();
// When an animation is disassociated with style it enters an odd state // When an animation is disassociated with style it enters an odd state
// where its composite order is undefined until it first transitions // where its composite order is undefined until it first transitions
@ -126,6 +125,11 @@ public:
mNeedsNewAnimationIndexWhenRun = true; mNeedsNewAnimationIndexWhenRun = true;
Animation::CancelFromStyle(); Animation::CancelFromStyle();
// We need to do this *after* calling CancelFromStyle() since
// CancelFromStyle might synchronously trigger a cancel event for which
// we need an owning element to target the event at.
mOwningElement = OwningElementRef();
} }
void Tick() override; void Tick() override;