RESOLVED FIXED Bug 179708
[Web Animations] Complete support for keyframe animations
https://bugs.webkit.org/show_bug.cgi?id=179708
Summary [Web Animations] Complete support for keyframe animations
Antoine Quint
Reported 2017-11-14 16:42:44 PST
We're adding basic support for from-to animations in https://bugs.webkit.org/show_bug.cgi?id=179707, but we need to support the full complexity of multiple keyframe animations.
Attachments
Patch (56.67 KB, patch)
2017-12-21 09:10 PST, Antoine Quint
no flags
Patch (56.68 KB, patch)
2017-12-21 11:11 PST, Antoine Quint
dino: review+
Antoine Quint
Comment 1 2017-12-12 04:41:25 PST
Antoine Quint
Comment 2 2017-12-21 09:10:18 PST
Antoine Quint
Comment 3 2017-12-21 11:11:23 PST
Dean Jackson
Comment 4 2017-12-21 11:12:28 PST
Comment on attachment 330032 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330032&action=review It stresses me out that so much code is landing without many tests. > Source/WebCore/animation/KeyframeEffect.cpp:101 > +static inline ExceptionOr<void> processIterableKeyframes(ExecState& state, Strong<JSObject>&& keyframesInput, JSValue method, Vector<KeyframeEffect::ProcessedKeyframe>& processedKeyframes) It might be nicer to have this function return an ExceptionOr<Vector<KeyframeEffect::ProcessedKeyframe>>, to avoid having an out parameter. > Source/WebCore/animation/KeyframeEffect.cpp:132 > + auto ownPropertyName = ownPropertyNames[j]; > + auto ownPropertyNameAsString = ownPropertyName.string(); > + auto ownPropertyRawValue = keyframe->get(&state, ownPropertyName); > + if (ownPropertyName == "easing") > + easing = convert<IDLDOMString>(state, ownPropertyRawValue); > + else if (ownPropertyNameAsString == "offset") > + offset = convert<IDLNullable<IDLDouble>>(state, ownPropertyRawValue); > + else if (ownPropertyName == "composite") What is ownPropertyNameAsString for? You already compare ownPropertyName == "easing" and "composite". Why is "offset" different?
Dean Jackson
Comment 5 2017-12-21 11:12:58 PST
Comment on attachment 330043 [details] Patch copying review from previous patch
Dean Jackson
Comment 6 2017-12-21 11:13:23 PST
I'm sure Darin or someone will find lots of nits.
Antoine Quint
Comment 7 2017-12-21 11:41:35 PST
(In reply to Dean Jackson from comment #4) > Comment on attachment 330032 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=330032&action=review > > It stresses me out that so much code is landing without many tests. There are many tests, they're simply all using Element.animate(), which is landing next. > > Source/WebCore/animation/KeyframeEffect.cpp:101 > > +static inline ExceptionOr<void> processIterableKeyframes(ExecState& state, Strong<JSObject>&& keyframesInput, JSValue method, Vector<KeyframeEffect::ProcessedKeyframe>& processedKeyframes) > > It might be nicer to have this function return an > ExceptionOr<Vector<KeyframeEffect::ProcessedKeyframe>>, to avoid having an > out parameter. Yes, I can do that. It was easier to follow the spec text by passing around the out parameter though. > > Source/WebCore/animation/KeyframeEffect.cpp:132 > > + auto ownPropertyName = ownPropertyNames[j]; > > + auto ownPropertyNameAsString = ownPropertyName.string(); > > + auto ownPropertyRawValue = keyframe->get(&state, ownPropertyName); > > + if (ownPropertyName == "easing") > > + easing = convert<IDLDOMString>(state, ownPropertyRawValue); > > + else if (ownPropertyNameAsString == "offset") > > + offset = convert<IDLNullable<IDLDouble>>(state, ownPropertyRawValue); > > + else if (ownPropertyName == "composite") > > What is ownPropertyNameAsString for? You already compare ownPropertyName == > "easing" and "composite". Why is "offset" different? I started out by only implementing offset, and then added easing and composite. But I see that JSC::Identifier, which is the type of ownPropertyName, supports string comparisons, so I'll remove ownPropertyName.
Antoine Quint
Comment 8 2017-12-21 11:51:43 PST
Note You need to log in before you can comment on or make changes to this bug.