Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: fcaf706998523701858ebe0ba15da4bcb372ddf1 https://github.com/WebKit/WebKit/commit/fcaf706998523701858ebe0ba15da4bcb372ddf1 Author: Antoine Quint <grao...@webkit.org> Date: 2024-04-12 (Fri, 12 Apr 2024)
Changed paths: M LayoutTests/imported/w3c/web-platform-tests/svg/animations/animateMotion-keyPoints-001-expected.txt M Source/WebCore/svg/SVGAnimationElement.cpp Log Message: ----------- [svg] WPT test svg/animations/animateMotion-keyPoints-001.html fails in WebKit only https://bugs.webkit.org/show_bug.cgi?id=272602 Reviewed by Dean Jackson. The SVG Animations spec says [0] that "the default value for the `calcMode` for `animateMotion` is `paced`". Further, on this `paced` value, the spec says [1] "if `paced` is specified, any `keyTimes` or `keySplines` will be ignored". I believe that based on this, our implementation always disregarded `keyTimes` when resolving animations for `<animationMotion>`. However, `svg/animations/animateMotion-keyPoints-001.html` has both `keyPoints` and `keyTimes` attributes and so WebKit ignores them. But the spec also says [2] "SVG adds a `keyPoints` attribute to the `animateMotion` to provide precise control of the velocity of motion path animations". While the spec is convoluted in this area, it would make little sense to ignore `keyPoints` for `<animationMotion>` when it's been expressly added for the purpose of this animation type, even though its `calcMode` is `paced` and `keyTimes` ought to be ignored. And in fact, Chrome and Firefox both respect those attributes and passes this test. So we change our implementation to use the `keyTimes` as specified via the attribute in `startedActiveInterval()` to determine whether the animation is valid and then, in `updateAnimation()`, call `calculatePercentFromKeyPoints()` to respect the `keyPoints` value in the case of an `<animateMotion>` element. This will also be required to pass the WPT test `svg/path/property/mpath.svg` (see bug 272416) which also uses an `<animateMotion>` element with a `keyPoints`/`keyTimes` attribute combination. [0] https://svgwg.org/specs/animations/#AnimateMotionElement [1] https://svgwg.org/specs/animations/#CalcModeAttribute [2] https://svgwg.org/specs/animations/#RelationshipToSMILAnimation * LayoutTests/imported/w3c/web-platform-tests/svg/animations/animateMotion-keyPoints-001-expected.txt: * Source/WebCore/svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints const): (WebCore::SVGAnimationElement::startedActiveInterval): (WebCore::SVGAnimationElement::updateAnimation): Canonical link: https://commits.webkit.org/277450@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes