WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
212103
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
Summary
[Web Animations] Animation engine should not wake up every tick for steps tim...
Antoine Quint
Reported
2020-05-19 13:03:19 PDT
[Web Animations] Animation engine should not wake up every tick for steps timing functions
Attachments
Patch
(18.77 KB, patch)
2020-05-19 13:12 PDT
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(22.25 KB, patch)
2020-05-20 03:45 PDT
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(24.63 KB, patch)
2020-05-20 03:49 PDT
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(27.99 KB, patch)
2020-05-20 06:59 PDT
,
Antoine Quint
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Antoine Quint
Comment 1
2020-05-19 13:12:08 PDT
Created
attachment 399764
[details]
Patch
Antoine Quint
Comment 2
2020-05-19 13:12:13 PDT
<
rdar://problem/62737868
>
Simon Fraser (smfr)
Comment 3
2020-05-19 13:26:25 PDT
Comment on
attachment 399764
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=399764&action=review
> Source/WebCore/animation/AnimationEffect.cpp:547 > + if (!is<StepsTimingFunction>(m_timingFunction)) > + return WTF::nullopt;
Does this get called for animations whose keyframes all have the same value? Or did we optimize those out earlier?
> Source/WebCore/animation/KeyframeEffect.cpp:1825 > + if (intervalEndProgress <= iterationProgress) > + continue; > + > + if (!i) > + break;
This is pretty confusing. The !i makes it always break after i=0, but you continue earlier. Easier to grok if it's flipped around somehow.
Antoine Quint
Comment 4
2020-05-19 13:48:00 PDT
(In reply to Simon Fraser (smfr) from
comment #3
)
> Comment on
attachment 399764
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=399764&action=review
> > > Source/WebCore/animation/AnimationEffect.cpp:547 > > + if (!is<StepsTimingFunction>(m_timingFunction)) > > + return WTF::nullopt; > > Does this get called for animations whose keyframes all have the same value? > Or did we optimize those out earlier?
We don’t optimize this case in any way for now. So this would get called for any animation.
> > Source/WebCore/animation/KeyframeEffect.cpp:1825 > > + if (intervalEndProgress <= iterationProgress) > > + continue; > > + > > + if (!i) > > + break; > > This is pretty confusing. The !i makes it always break after i=0, but you > continue earlier. Easier to grok if it's flipped around somehow.
The order matters here. We just want to be sure that we don’t deal with an implicit 0% keyframe since we wouldn’t have a blending keyframe for that and would otherwise crash trying to access its timing function.
Antoine Quint
Comment 5
2020-05-20 03:45:53 PDT
Created
attachment 399827
[details]
Patch
Antoine Quint
Comment 6
2020-05-20 03:49:03 PDT
Created
attachment 399828
[details]
Patch
Antoine Quint
Comment 7
2020-05-20 06:59:14 PDT
Created
attachment 399835
[details]
Patch
Simon Fraser (smfr)
Comment 8
2020-05-20 08:15:30 PDT
Comment on
attachment 399835
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=399835&action=review
> Source/WebCore/animation/KeyframeEffect.cpp:1476 > + if (index < 0) > + return nullptr;
size_t is unsigned, this can never happen.
> Source/WebCore/animation/KeyframeEffect.cpp:1837 > +Optional<double> KeyframeEffect::progressUntilNextStep(double iterationProgress) const
"progress until" is a bit ambiguous here. Maybe "progress at next step"?
Antoine Quint
Comment 9
2020-05-20 09:24:31 PDT
(In reply to Simon Fraser (smfr) from
comment #8
)
> Comment on
attachment 399835
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=399835&action=review
> > > Source/WebCore/animation/KeyframeEffect.cpp:1476 > > + if (index < 0) > > + return nullptr; > > size_t is unsigned, this can never happen.
Will remove in commit.
> > Source/WebCore/animation/KeyframeEffect.cpp:1837 > > +Optional<double> KeyframeEffect::progressUntilNextStep(double iterationProgress) const > > "progress until" is a bit ambiguous here. Maybe "progress at next step"?
"progress at next step" would not be correct, what we want to know is "how much progress until the next step". I think within the context of determining the amount of time before the next step, which is the only scenario in which this method is used, this is clear enough.
Antoine Quint
Comment 10
2020-05-20 09:26:25 PDT
Committed
r261926
: <
https://trac.webkit.org/changeset/261926
>
Antoine Quint
Comment 11
2020-05-20 09:29:57 PDT
Committed
r261927
: <
https://trac.webkit.org/changeset/261927
>
Antoine Quint
Comment 12
2024-05-21 02:40:10 PDT
***
Bug 45447
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug