Nothing Special   »   [go: up one dir, main page]

Page MenuHomePhabricator

Bug 1676791 - Part 5: Define the finite timeline and use it in Play() and Pause().
ClosedPublic

Authored by boris on Nov 15 2021, 8:32 PM.

Details

Summary

Based on https://github.com/w3c/csswg-drafts/pull/4842, we define
"has finite timeline", which is a timeline that's not monotonically increasing.
We need this to update start time and hold time for scroll-timeline, so
we play scroll-linked animations as we expected, e.g. GetLocalTime() returns
the correct time value from GetCurrentTimeAsDuration().

Known issue: we still have bugs when setting "animation-play-state:paused".
Will do that in Bug 1741255.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable
Build Status
Buildable 379384
Build 474221: arc lint + arc unit

Event Timeline

boris added a reviewer: Restricted Project.Nov 15 2021, 8:32 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Code analysis found 3 defects in the diff 508052:

  • 3 defects found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

For your convenience, here is a patch that fixes all the clang-format defects (use it in your repository with hg import or git apply -p0).


If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

hiro added a subscriber: hiro.

Looks great! (Though I wasn't aware of the spec change, it exactly matches my mental model of scroll linked animation)

To be honest, I don't know there's any tests specific for this change, but I suppose most of scroll-linked animation test cases won't work without this change.

dom/animation/Animation.cpp
1377

Can we factor out this mTimeline && !mTimeline->IsMonotonicallyIncreasing() as HasFiniteTimeline() function? And if the implementation is defined in Animation.h, I'd expect it'd be inlined.

dom/animation/AnimationTimeline.h
106

suggestion: we should make this function virtual, and return true in DocumentTimeline, return false in ScrollTimeline.

This revision is now accepted and ready to land.Nov 16 2021, 2:48 AM

To be honest, I don't know there's any tests specific for this change, but I suppose most of scroll-linked animation test cases won't work without this change.

Yes. This PR is for scroll animations. Without this, we cannot pass the tests added in the patch series.

boris marked 2 inline comments as done.

Address comments

Code analysis found 3 defects in the diff 509248:

  • 3 defects found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

boris retitled this revision from Bug 1676791 - Part 4: Define the finite timeline and use it in Play() and Pause(). to Bug 1676791 - Part 5: Define the finite timeline and use it in Play() and Pause()..Nov 18 2021, 12:06 AM
boris removed a reviewer: Restricted Project.Nov 18 2021, 11:13 PM

Address final comments and rebased

Code analysis found 3 defects in the diff 513973:

  • 3 defects found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

Code analysis found 3 defects in the diff 516529:

  • 3 defects found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

Move test and ready to land

Code analysis found 3 defects in the diff 516649:

  • 3 defects found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

boris added a commit: Restricted Diffusion Commit.Feb 18 2022, 7:45 PM