Bug 1194639 part 3 - Report changes to startTime to animation mutation observers; r=heycam

This commit is contained in:
Brian Birtles 2015-10-22 15:16:18 +09:00
parent eab83a05b4
commit 66cb8a4081
2 changed files with 10 additions and 0 deletions

View File

@ -128,6 +128,12 @@ Animation::SetTimeline(AnimationTimeline* aTimeline)
void void
Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime) Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
{ {
if (aNewStartTime == mStartTime) {
return;
}
AutoMutationBatchForAnimation mb(*this);
Nullable<TimeDuration> timelineTime; Nullable<TimeDuration> timelineTime;
if (mTimeline) { if (mTimeline) {
// The spec says to check if the timeline is active (has a resolved time) // The spec says to check if the timeline is active (has a resolved time)
@ -157,6 +163,9 @@ Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
} }
UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async); UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
if (IsRelevant()) {
nsNodeUtils::AnimationChanged(this);
}
PostUpdate(); PostUpdate();
} }

View File

@ -693,6 +693,7 @@ function assert_records(expected, desc) {
// notification. // notification.
[ [
{ prop: "playbackRate", val: 0.5 }, { prop: "playbackRate", val: 0.5 },
{ prop: "startTime", val: 50000 },
].forEach(function(aChangeTest) { ].forEach(function(aChangeTest) {
addAsyncAnimTest(`single_animation_api_change_${aChangeTest.prop}`, addAsyncAnimTest(`single_animation_api_change_${aChangeTest.prop}`,
aOptions, function*() { aOptions, function*() {