Closed Bug 1207951 Opened 9 years ago Closed 9 years ago

When Animation::ComposeStyle updates the compose time, it should not call UpdateTiming

Categories

(Core :: DOM: Animation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: birtles, Assigned: birtles)

References

Details

Attachments

(1 file, 1 obsolete file)

This call seems astray: https://dxr.mozilla.org/mozilla-central/rev/abe43c30d78d7546ed7c622c5cf62d265709cdfd/dom/animation/Animation.cpp#647 It was added way back here: https://hg.mozilla.org/mozilla-central/rev/6df80592242c in bug 1109390. I can't understand, however, why we call UpdateSourceContent (now UpdateEffect) when we update the time, but UpdateTiming afterwards. Furthermore, it seems like we call UpdateTiming *before* restoring the hold time. Basically, this code makes no sense and I can't find any explanation in the bug of why it is doing this way. I think we should replace the call to UpdateTiming with one to UpdateEffect and move it outside the scoped block (i.e. after the dtor for the AutoRestore object has run).
Attached patch Fix buggy logic in ComposeStyle (obsolete) — Splinter Review
Assignee: nobody → bbirtles
Status: NEW → ASSIGNED
We should also get rid of the redundant call to PlayState()
Attachment #8665833 - Flags: review?(cam)
Attachment #8665301 - Attachment is obsolete: true
Comment on attachment 8665833 [details] [diff] [review] Fix buggy logic in ComposeStyle Review of attachment 8665833 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/animation/Animation.cpp @@ -620,5 @@ > { > AutoRestore<Nullable<TimeDuration>> restoreHoldTime(mHoldTime); > - bool updatedHoldTime = false; > - > - AnimationPlayState playState = PlayState(); Can we turn on -Wshadow for dom/animation/? @@ +649,2 @@ > > + mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished); Is there anything in the temporarily-change-hold-time block that could cause the play state to change, such that it would make sense to assert just before this line that playState == PlayState()?
Attachment #8665833 - Flags: review?(cam) → review+
Blocks: 1208929
(In reply to Cameron McCormack (:heycam) (away Oct 2) from comment #5) > ::: dom/animation/Animation.cpp > @@ -620,5 @@ > > { > > AutoRestore<Nullable<TimeDuration>> restoreHoldTime(mHoldTime); > > - bool updatedHoldTime = false; > > - > > - AnimationPlayState playState = PlayState(); > > Can we turn on -Wshadow for dom/animation/? I filed bug 1207951 for this. > @@ +649,2 @@ > > > > + mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished); > > Is there anything in the temporarily-change-hold-time block that could cause > the play state to change, such that it would make sense to assert just > before this line that playState == PlayState()? I've added that assertion now.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: