Fix handling of multiple keyframes at same offset

When multiple keyframes have the same offset, we cannot always ignore
all but the last-specified keyframe. In particular, if iteration
progress is negative (e.g. due to easing), the first keyframe with
offset 0 is used. See spec:
https://w3c.github.io/web-animations/#the-effect-value-of-a-keyframe-animation-effect

This patch fixes our implementation in order to pass the W3C
web-animations/keyframe-effect/keyframe-handling.html test.
It involves
(a) not removing as redundant those end keyframes that have the same
    offset as their neighbours,
(b) allowing interpolations with the same offset at both ends, and
(c) using the same keyframe as both endpoints in interpolations
    where the offset is the same for both ends.

BUG=600248

Review-Url: https://codereview.chromium.org/1942703002
Cr-Commit-Position: refs/heads/master@{#391464}
3 files changed