- From: Robert Flack via GitHub <sysbot+gh@w3.org>
- Date: Thu, 12 Sep 2024 16:47:34 +0000
- To: public-css-archive@w3.org
> The section on [custom effects](https://drafts.csswg.org/web-animations-2/#custom-effects) in the current level 2 spec starts with this issue: > > > This whole feature needs to be revisited. The current thinking is that rather than having custom effects, we should simply have an onupdate callback on each animation effect. That would allow, for example, augmenting an existing effect with a function that performs logging or triggers additional actions at certain times. With the current arrangement, doing this would require adding a parent group just to achieve this. > > I personally think that a dedicated `CustomEffect` interface is a simple and purposeful way to specify an animation where its _application_ is performed by script. I expect that it is simpler to specify how this specific class of effects would work rather than trying to add an `onupdate` callback that would apply to keyframe effects as well. I think that the timing with respect to other effects needs to be clear either way. I think having a set of post-animation update callbacks is probably simpler to be honest. The other thing that may be cleaner about an update callback is that we may be able to skip it if the effect easing resulted in no change. E.g. ```js canvas.animate({}, {duration: 1000, easing: steps(10)}).onupdate((localTime) => { // Only needs to be called 10 times? }); ``` > You'll also notice the lack of a `target` for `CustomEffect`. I believe that it should not be necessary to specify a target for a custom effect since it may not target a single node, or even a node at all, but rather a JS object controlling the rendering of a scene using `<canvas>` APIs. I agree that conceptually it makes sense to not have a target, though it could be a nice feature if we could skip custom effects if the target (e.g. the canvas being drawn to) was not in view or at least if the target is detached. -- GitHub Notification of comment by flackr Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6861#issuecomment-2346785579 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 12 September 2024 16:47:35 UTC