Repository navigation
Conversation
Addresses w3c#6861.
https://bugs.webkit.org/show_bug.cgi?id=334376 rdar://194304792 Reviewed by Simon Fraser. After some conversations on a CSS WG call and discussion on the spec issue [0] there is now spec PR [1] for custom effects. As such this feature is advanced enough that it should be made available as a tech preview. [0] w3c/csswg-drafts#6861 [1] w3c/csswg-drafts#14946 * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Canonical link: https://commits.webkit.org/328862@main
ydaniv
left a comment
There was a problem hiding this comment.
Have some initial questions. Some may be a bit high level, so may require an issue of their own.
| callback EffectCallback = undefined (double? progress, | ||
| (Element or CSSPseudoElement) currentTarget, | ||
| Animation animation); | ||
| callback CustomEffectCallback = undefined (double? progress, |
There was a problem hiding this comment.
Would this progress be mapped to the effect's progress or the animation's overallProgress?
Would it make sense, perhaps, to provide a property bag here, instead of a number, which can hold all the relevant timing options, and we can later expose more as needed.
So authors could write:
new CustomEffect(({ progress, overallProgress, elapsedTime }) => { ... })| <div dfn-type=dict-member class=members | ||
| dfn-for="CustomEffectOptions"> | ||
|
|
||
| : <dfn>target</dfn> |
There was a problem hiding this comment.
What would having a target mean for a CustomEffect? And how can you access it from within the callback?
|
|
||
| <div class="parameters"> | ||
|
|
||
| : double? progress |
There was a problem hiding this comment.
What does progress equal when we're outside the active range and fill doesn't persist the effect?
| @@ -3263,33 +3257,83 @@ | |||
| When this is <code>null</code>, the function SHOULD | |||
There was a problem hiding this comment.
Should we perhaps, instead, rely on the removing replaced animations procedure?
For example, what would calling persist() do to CustomEffects?
| Issue: This whole feature needs to be revisited. The current thinking is that | ||
| rather than having custom effects, we should simply have an | ||
| <code>onupdate</code> callback on each <a>animation effect</a>. 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. |
Define the
CustomEffectinterface and theCustomEffectOptionsdictionary. Addresses #6861.