Bug 167041 - Make tracking which Animation properties are set or filled more efficient
Summary: Make tracking which Animation properties are set or filled more efficient
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-13 18:10 PST by Said Abou-Hallawa
Modified: 2023-05-11 03:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (42.33 KB, patch)
2017-01-13 18:19 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (44.04 KB, patch)
2017-01-13 19:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (46.46 KB, patch)
2017-01-13 19:30 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (49.05 KB, patch)
2017-01-13 19:49 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (54.22 KB, patch)
2017-01-17 18:18 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (54.22 KB, patch)
2017-01-17 19:16 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (54.28 KB, patch)
2017-01-17 19:38 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (54.85 KB, patch)
2017-01-18 09:02 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (54.89 KB, patch)
2017-01-18 09:31 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (55.16 KB, patch)
2017-01-18 09:42 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (55.56 KB, patch)
2017-01-18 10:17 PST, Said Abou-Hallawa
mjs: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-01-13 18:10:06 PST
-- Shorten the enum names and use enum class instead.
-- Use std::optional for the members instead of tracking setting them variable by a set of booleans.
Comment 1 Said Abou-Hallawa 2017-01-13 18:19:58 PST
Created attachment 298823 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-01-13 19:06:22 PST
Created attachment 298829 [details]
Patch
Comment 3 Said Abou-Hallawa 2017-01-13 19:30:20 PST
Created attachment 298832 [details]
Patch
Comment 4 Said Abou-Hallawa 2017-01-13 19:49:46 PST
Created attachment 298838 [details]
Patch
Comment 5 Said Abou-Hallawa 2017-01-17 18:18:40 PST
Created attachment 299102 [details]
Patch
Comment 6 Said Abou-Hallawa 2017-01-17 19:16:36 PST
Created attachment 299109 [details]
Patch
Comment 7 Jon Lee 2017-01-17 19:28:33 PST
Comment on attachment 299109 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299109&action=review

> Source/WebCore/css/makeprop.pl:604
> +    $setterContent .= $indent . "list.animation(0).setterContent(Animation::Mode::All);\n";

Is this correct?
Comment 8 Said Abou-Hallawa 2017-01-17 19:38:40 PST
Created attachment 299110 [details]
Patch
Comment 9 Said Abou-Hallawa 2017-01-17 19:41:52 PST
Comment on attachment 299109 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299109&action=review

>> Source/WebCore/css/makeprop.pl:604
>> +    $setterContent .= $indent . "list.animation(0).setterContent(Animation::Mode::All);\n";
> 
> Is this correct?

No it is not correct. I do not remember how it happened. It looks like it happened because of either a bad merge or a bad copy/paste.
Comment 10 Said Abou-Hallawa 2017-01-18 09:02:16 PST
Created attachment 299147 [details]
Patch
Comment 11 Said Abou-Hallawa 2017-01-18 09:31:15 PST
Created attachment 299150 [details]
Patch
Comment 12 Said Abou-Hallawa 2017-01-18 09:42:40 PST
Created attachment 299151 [details]
Patch
Comment 13 Said Abou-Hallawa 2017-01-18 10:17:02 PST
Created attachment 299154 [details]
Patch
Comment 14 Darin Adler 2017-01-18 13:06:19 PST
Comment on attachment 299154 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299154&action=review

> Source/WebCore/platform/animation/Animation.cpp:32
> +    : m_mode(Mode::All)
> +    , m_isNone(false)
> +    , m_nameStyleScopeOrdinal(Style::ScopeOrdinal::Element)

Why not initialize these in the class definition/

> Source/WebCore/platform/animation/Animation.cpp:38
> +    , m_timingFunction(initialTimingFunction())
> +    , m_timingFunctionSet(false)

Could we instead use an optional or use RefPtr and have null mean not set? If keeping a separate boolean, could we initialize in the class definition?

> Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:530
> +        animationObject->setTimingFunction(*timingFunction.leakRef());

I don’t see how this could be correct. There’s a reason this function is named "leak". Are you sure tis is right?
Comment 15 Maciej Stachowiak 2020-05-30 18:01:50 PDT
Comment on attachment 299154 [details]
Patch

This patch no longer applies (per EWS). I did not review whether it's a good idea, but r- for not applying any more.
Comment 16 Said Abou-Hallawa 2023-05-10 11:57:02 PDT
This patch does not apply anymore. The code has changed a lot. So resolve it as INVALID.
Comment 17 Antoine Quint 2023-05-10 12:26:35 PDT
Actually, using std::optional<> would be nice rather than keeping two sets of instance variables. Re-opening this and rephrasing.
Comment 18 Antoine Quint 2023-05-10 12:26:54 PDT
Re-opening to fix.
Comment 19 Antoine Quint 2023-05-10 12:46:17 PDT
Might be even better to use Markable here.
Comment 20 Antoine Quint 2023-05-11 01:46:17 PDT
Actually, we should go beyond tracking which properties are set and also improve how we track which properties are filled.
Comment 21 Antoine Quint 2023-05-11 03:06:18 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13750