Changeset 290125 in webkit
- Timestamp:
- Feb 18, 2022 7:44:59 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webanimations/frame-rate/animation-frame-rate-expected.txt (modified) (1 diff)
-
LayoutTests/webanimations/frame-rate/animation-frame-rate.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/CustomAnimationOptions.h (modified) (2 diffs)
-
Source/WebCore/animation/CustomAnimationOptions.idl (modified) (1 diff)
-
Source/WebCore/animation/DocumentTimeline.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r290124 r290125 1 2022-02-18 Antoine Quint <graouts@webkit.org> 2 3 [frame-rate] [custom-effect] allow setting frameRate as an option passed to document.timeline.animate() 4 https://bugs.webkit.org/show_bug.cgi?id=236831 5 6 Reviewed by Dean Jackson. 7 8 * webanimations/frame-rate/animation-frame-rate-expected.txt: 9 * webanimations/frame-rate/animation-frame-rate.html: 10 1 11 2022-02-18 Ziran Sun <zsun@igalia.com> 2 12 -
trunk/LayoutTests/webanimations/frame-rate/animation-frame-rate-expected.txt
r290123 r290125 3 3 PASS Invalid animation.frameRate values 4 4 PASS Calling element.animate() allows setting animation.frameRate 5 PASS Calling document.timeline.animate() allows setting animation.frameRate 5 6 -
trunk/LayoutTests/webanimations/frame-rate/animation-frame-rate.html
r290123 r290125 52 52 }, "Calling element.animate() allows setting animation.frameRate"); 53 53 54 test(t => { 55 const animation = frameRate => document.timeline.animate(() => { }, { frameRate }); 56 57 // Numeric value. 58 assert_equals(animation(30).frameRate, 30, "frameRate can be set to a numeric value"); 59 60 // Presets. 61 for (let value of presets) 62 assert_equals(animation(value).frameRate, value, "frameRate can be set to a preset value"); 63 64 // Invalid values. 65 for (let value of invalidValues) 66 assert_throws_js(TypeError, () => animation(value), `providing the invalid value "${value}" throws`); 67 }, "Calling document.timeline.animate() allows setting animation.frameRate"); 68 54 69 </script> 55 70 </body> -
trunk/Source/WebCore/ChangeLog
r290124 r290125 1 2022-02-18 Antoine Quint <graouts@webkit.org> 2 3 [frame-rate] [custom-effect] allow setting frameRate as an option passed to document.timeline.animate() 4 https://bugs.webkit.org/show_bug.cgi?id=236831 5 6 Reviewed by Dean Jackson. 7 8 * animation/CustomAnimationOptions.h: 9 * animation/CustomAnimationOptions.idl: 10 * animation/DocumentTimeline.cpp: 11 (WebCore::DocumentTimeline::animate): 12 1 13 2022-02-18 Ziran Sun <zsun@igalia.com> 2 14 -
trunk/Source/WebCore/animation/CustomAnimationOptions.h
r286555 r290125 26 26 #pragma once 27 27 28 #include "AnimationFrameRate.h" 29 #include "AnimationFrameRatePreset.h" 28 30 #include "EffectTiming.h" 29 31 … … 32 34 struct CustomAnimationOptions : EffectTiming { 33 35 String id; 36 std::variant<FramesPerSecond, AnimationFrameRatePreset> frameRate; 34 37 }; 35 38 -
trunk/Source/WebCore/animation/CustomAnimationOptions.idl
r286555 r290125 24 24 */ 25 25 26 typedef unsigned long FramesPerSecond; 27 26 28 dictionary CustomAnimationOptions : EffectTiming { 27 29 DOMString id = ""; 30 [EnabledBySetting=WebAnimationsCustomFrameRateEnabled] (FramesPerSecond or AnimationFrameRatePreset) frameRate = "auto"; 28 31 }; 29 32 -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r290003 r290125 454 454 455 455 String id = ""; 456 std::variant<FramesPerSecond, AnimationFrameRatePreset> frameRate = AnimationFrameRatePreset::Auto; 456 457 std::optional<std::variant<double, EffectTiming>> customEffectOptions; 457 458 … … 463 464 auto customEffectOptions = std::get<CustomAnimationOptions>(*options); 464 465 id = customEffectOptions.id; 466 frameRate = customEffectOptions.frameRate; 465 467 customEffectOptionsVariant = WTFMove(customEffectOptions); 466 468 } … … 474 476 auto animation = WebAnimation::create(*document(), &customEffectResult.returnValue().get()); 475 477 animation->setId(id); 478 animation->setBindingsFrameRate(WTFMove(frameRate)); 476 479 477 480 auto animationPlayResult = animation->play();
Note: See TracChangeset
for help on using the changeset viewer.