LibWeb: Reject invalid keyframe offset values

This commit is contained in:
Matthew Olsson
2024-05-31 10:43:21 -07:00
committed by Andreas Kling
parent e13cd914a9
commit 73aadddbc1
Notes: sideshowbarker 2024-07-17 14:36:19 +09:00
3 changed files with 14 additions and 4 deletions

View File

@@ -19,6 +19,10 @@
checkException('KeyframeEffect with NaN endDelay value', () => new KeyframeEffect(null, null, { endDelay: NaN }));
checkException('KeyframeEffect with NaN iterations', () => new KeyframeEffect(null, null, { iterations: NaN }));
checkException('KeyframeEffect with non-"auto" string duration', () => new KeyframeEffect(null, null, { duration: 'abc' }))
checkException('KeyframeEffect with non-numeric offset', () => new KeyframeEffect(null, [{ offset: 'abc' }], {}));
checkException('KeyframeEffect with invalid numeric offset', () => new KeyframeEffect(null, [{ offset: -1 }], {}));
println('');
// Test valid values
checkException('KeyframeEffect with infinite options value', () => new KeyframeEffect(null, null, Infinity));