Page MenuHomePhabricator

Bug 1846516 - [css-properties-values-api] Animate custom properties in a discrete way. r=fredw,zsun,#animation!,#style
ClosedPublic

Authored by zrhoffman on Oct 12 2023, 8:38 AM.
Referenced Files
Unknown Object (File)
Mar 18 2026, 7:51 AM
Unknown Object (File)
Mar 16 2026, 11:18 PM
Unknown Object (File)
Mar 15 2026, 3:55 AM
Unknown Object (File)
Mar 14 2026, 10:27 PM
Unknown Object (File)
Mar 14 2026, 7:36 PM
Unknown Object (File)
Mar 14 2026, 4:33 PM
Unknown Object (File)
Mar 14 2026, 4:32 PM
Unknown Object (File)
Mar 14 2026, 1:03 PM

Details

Summary

This patch also updates the bug ID for a FIXME leftover from bug 1840478
to bug 1869476, since the same FIXME is added in D190758.

Co-authored-by: Frederic Wang <[email protected]>

Depends on D191322

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
emilio requested changes to this revision.Dec 8 2023, 5:09 PM
emilio added inline comments.
servo/components/style/properties/helpers/animated_properties.mako.rs
183

I don't understand why you need this. The this_tag != other_tag should still be sound without this.

If you have a single CustomAnimatedValue struct rather than two members in the Custom tag then you can reuse the common codepath.

servo/ports/geckolib/glue.rs
656

Why only for logical properties? I don't understand this.

This revision now requires changes to proceed.Dec 8 2023, 5:09 PM
zrhoffman updated this revision to Diff 797599.
zrhoffman retitled this revision from Bug 1846516 - [css-properties-values-api] Animate custom properties in a discrete way. r=fredw,zsun,#animation,#style to Bug 1846516 - [css-properties-values-api] Animate custom properties in a discrete way. r=fredw,zsun,#animation!,#style.
zrhoffman edited the summary of this revision. (Show Details)
zrhoffman marked 2 inline comments as done.

Address reviews of D190911, D191059, and D190758.

servo/components/style/properties/helpers/animated_properties.mako.rs
183

Agreed, (Custom(..), _) | (_, Custom(..)) branch removed.

servo/ports/geckolib/glue.rs
656

It was crashing on value_map.get(&property) on the next line for custom properties, because Gecko_AnimationGetBaseStyle was casting aBaseStyles to nsRefPtrHashtable<nsUint32HashKey, StyleAnimationValue>*.

Fixed the crash by instead casting aBaseStyles to const nsRefPtrHashtable<nsGenericHashKey<AnimatedPropertyID>, StyleAnimationValue> in D191322.

The analysis task source-test-mozlint-mingw-cap failed, but we could not detect any defect.
Please check this task manually.


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

The analysis task source-test-clang-format failed, but we could not detect any defect.
Please check this task manually.


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

emilio added a project: testing-approved.
emilio removed a reviewer: Restricted Project.
emilio added inline comments.
dom/animation/KeyframeEffect.cpp
702–703

Let's split this assert probably:

MOZ_ASSERT(aProperty != eCSSPropertyExtra_variable, "Can't animate variables on compositor");
...

Or so.

servo/components/style/properties/declaration_block.rs
184

Let's do:

if !self.longhands.contains_all(&properties.longhands) {
    return false;
}
if properties.custom.len() > self.custom.len() {
    return false;
}
properties.custom.iter().all(|item| self.custom.contains(item))

To avoid iterating over a gazillion props unnecessarily in some cases.

servo/components/style/properties/helpers/animated_properties.mako.rs
183

Can you file a follow-up to merge the Custom(name, value) into a single Custom(<struct>) variant, so that we can use the same code-path as everything else?

This revision is now accepted and ready to land.Dec 11 2023, 12:38 PM

Fix web-animations/interfaces/Animation/commitStyles.html crash

zrhoffman edited the summary of this revision. (Show Details)
zrhoffman marked 3 inline comments as done.

Address review of D190816, D191322, and D190758.

dom/animation/KeyframeEffect.cpp
702–703

Assert split.

servo/components/style/properties/declaration_block.rs
184

Split conditions and added the length check condition.

servo/components/style/properties/helpers/animated_properties.mako.rs
183

Filed bug 1869472 and added a TODO for it.

Code analysis found 2 defects in diff 798355:

  • 2 build errors found by clang-tidy
IMPORTANT: Found 2 defects (error level) that must be fixed before landing.

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 in the Diff Detail section of Phabricator diff 798355.

zrhoffman edited the summary of this revision. (Show Details)

2 defects closed compared to the previous diff 798355.


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

zrhoffman edited the summary of this revision. (Show Details)

Rebase onto autoland