LibWeb: Copy the keyframes in KeyframeEffect's copy constructor

This commit is contained in:
Matthew Olsson 2024-06-02 10:09:30 -07:00 committed by Andreas Kling
parent 5b84bd6e45
commit b5c682bc2e
3 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,2 @@
anim count: 1
keyframe: {"offset":null,"computedOffset":1,"easing":"linear","composite":"auto","marginLeft":"10px"}

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<script src="../../include.js"></script>
<script>
test(() => {
let effect = new KeyframeEffect(null, [{ marginLeft: "10px" }]);
let copiedEffect = new KeyframeEffect(effect);
let copiedKeyframes = copiedEffect.getKeyframes();
println(`anim count: ${copiedKeyframes.length}`);
if (copiedKeyframes.length > 0)
println(`keyframe: ${JSON.stringify(copiedKeyframes[0])}`);
})
</script>

View file

@ -706,8 +706,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<KeyframeEffect>> KeyframeEffect::construct_
// - effect target,
effect->m_target_element = source->target();
// FIXME:
// - keyframes,
effect->m_keyframes = source->m_keyframes;
// - composite operation, and
effect->set_composite(source->composite());