Closed Bug 1572755 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 18356 - Fix bug where composite: replace did not replace previous effects

Categories

(Core :: DOM: Animation, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: wptsync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 18356 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/18356
Details from upstream follow.

Stephen McGruer <smcgruer@chromium.org> wrote:

Fix bug where composite: replace did not replace previous effects

Consider a set of effects:

e.animate([{ "width": "0" }, { "width": "5px" }], { duration: 100 });
e.animate([{ "width": "0" }, { "width": "5px" }], { duration: 100, composite: 'add' });
e.animate([{ "width": "0" }, { "width": "2px" }], { duration: 100 });
e.animate([{ "width": "0" }, { "width": "2px" }], { duration: 100, composite: 'add' });

Previously the code in CopyToActiveInterpolationsMap would incorrectly
move the third effect to the start of the list to replace the original
keyframe pair, resulting in an effect stack of:

{ "width": "0" }, { "width": "2px" }
{ "width": "0" }, { "width": "5px" }
{ "width": "0" }, { "width": "2px" }

This is wrong; not only has it retained an effect it shouldn't have, it
has also re-ordered keyframes which might break non-commutative additive
properties. This CL fixes the logic to properly clear out existing
effects when a composite: 'replace' effect is put onto the stack.

Bug: 992378
Change-Id: I94ae54429ac7d4d28a0702d397ab64c2e45dee65
Reviewed-on: https://chromium-review.googlesource.com/1746302
WPT-Export-Revision: e4761f59f73b57cf97771f81561a2baa0bf49a2e

Component: web-platform-tests → DOM: Animation
Product: Testing → Core
Ran 1 tests and 11 subtests
OK     : 1
PASS   : 11
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9780850967f
[wpt PR 18356] - Fix bug where composite: replace did not replace previous effects, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.