Commit Graph

2391 Commits

Author SHA1 Message Date
Mark Banner
8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Emilio Cobos Álvarez
a7526d2a34 Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 22:31:38 +00:00
Butkovits Atila
cc740ca292 Backed out changeset f6e3d050b3e7 (bug 1832173) for causing bustages at CanvasRenderingContext2D.cpp. CLOSED TREE 2023-05-13 01:16:03 +03:00
Emilio Cobos Álvarez
7fc0f42cee Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 21:37:19 +00:00
Emilio Cobos Álvarez
6f904444e8 Bug 1832173 - Remove HasArcFFI for AnimationValue. r=boris
See previous patches for context.

Differential Revision: https://phabricator.services.mozilla.com/D177622
2023-05-11 08:25:36 +00:00
Emilio Cobos Álvarez
1c967006ab Bug 1831539 - Remove HasBoxFFI. r=boris
HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of
why.

HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much
benefit. Instead use the same type in the FFI boundary.

Differential Revision: https://phabricator.services.mozilla.com/D177252
2023-05-09 11:07:26 +00:00
Boris Chiou
3e70138099 Bug 1814444 - Part 2: Support self keyword for scroll(). r=emilio
`self` keyword specifies to use the element’s own principal box as the
scroll container. If the principal box is not a scroll container, then the
scroll progress timeline is inactive.

Differential Revision: https://phabricator.services.mozilla.com/D175707
2023-05-04 21:35:14 +00:00
Boris Chiou
cbb25b7480 Bug 1677844 - Let getAnimations() return scroll animations with null timeline. r=webidl,smaug,emilio
This is a tentative way to avoid any timeout in WPT because other
brower vendors may expect getAnimations() works for scroll animations.

The original implementation is error-prone because the user can use the
declarative way to create a CSS animation associated with the document-timeline,
and then changes animation-timeline property to any other scroll-timeline.
If the user calls getAnimations() before changing its style, we still expose
the Animation objects in JS and may crash or have other unexpected bahaviors
if the user tries to access Animation.timeline.

Besides, another benefit of this patch is that we can use other Web Animation
APIs for scroll animations in WPT, e.g. Animation.ready.

Differential Revision: https://phabricator.services.mozilla.com/D176966
2023-05-03 22:49:21 +00:00
Boris Chiou
77a0fd63cf Bug 1808410 - Part 3: Create timeline for view(). r=emilio
Also, I add some similar tests but they don't use Named Timeline Range, which
is not supported by Gecko now (Bug 1824875).

Differential Revision: https://phabricator.services.mozilla.com/D173905
2023-05-02 22:47:29 +00:00
Boris Chiou
f332d39f49 Bug 1737920 - Part 3: Look up named view timeline for CSS animations and update WPT expectations. r=emilio
Disable OMTA support for now. We have to make sure what should we do when
the subject is scrolled to "out of view" on the compositor, in Bug 1818346.
And we have to make sure view-timeline-inset animation work well on the
compositor.

Also, update tests,
1) timeline-offset-keyframes-hidden-subject.html, and
2) view-timeline-keyframe-boundary-interpolation.html,
to avoid js error because Gecko doesn't expose Animation object with
scroll-timeline or view-timeline.

And update test, view-timeline-lookup.html, because scroll progress timelines
take precedence over view progress timelines (i.e. choose the matched scroll
progress timeline first), per the spec in
https://drafts.csswg.org/scroll-animations-1/#timeline-scope.

Differential Revision: https://phabricator.services.mozilla.com/D170004
2023-04-12 20:52:03 +00:00
Boris Chiou
aeea17ac40 Bug 1737920 - Part 2: Calculate offsets for ViewTimeline. r=emilio
The definition of at-progress-timeline-boundary is updated to use the
unconstructed current timeline if we have, so we update the
implementation as well. It is necessary for view-timeline.

Basically, we use offsets to control the animation progress.
For scroll-timeline, it's simply 0 to the scroll range.
For view-timeline, its progress is between 0% and 100% if the subject element
is in the view. Otherwise, its progress is outside the range.

This patch series doesn't take Named Timeline Range into account because
I expect we will handle them in different bugs, e.g. support the keyframe
selector with `<timeline-range-name>` in Bug 1823509.

So only the basic scenario is implemented:
1. 0% progress represents the position at which the start border edge of the
   element’s principal box coincides with the end edge of its view progress
   visibility range. (e.g. the top of the subject touches the bottom of
   the scrollport, for the vertical axis.)
2. 100% progress represents the position at which the end border edge of the
   element’s principal box coincides with the start edge of its view progress
   visibility range. (e.g. the bottom of the subject touches the top of
   the scrollport, for the vertical axis.)

So basically, it is equal to `cover` range (i.e. we run the animation
when the scrollport covers the subject), per
https://drafts.csswg.org/scroll-animations-1/#valdef-animation-timeline-range-cover

Note: OMTA will be disabled for view timeline in the next patch. So we
implement this only on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D170002
2023-04-12 20:52:02 +00:00
Boris Chiou
ccc24f9fa1 Bug 1737920 - Part 1: Create ViewTimeline when specifying view-timeline property. r=emilio
However, We don't lookup the object of view-timeline-name for CSS animations
until we finish its implementation in the patch series.

Note: this patch assumes `view-timeline-inset` is not animatable. We will
fix it in Bug 1817073.

Differential Revision: https://phabricator.services.mozilla.com/D170001
2023-04-12 20:52:02 +00:00
Olli Pettay
ce96f3bd14 Bug 1826603 - Don't dispatch transition events if there are no listeners, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D174829
2023-04-06 09:09:33 +00:00
Daniel Holbert
86fdc8655d Bug 1822907 part 2: When handling a content-visibility change, don't insert already-completed animations into the timeline's sampling-order list. r=hiro
We have an invariant that the mAnimationOrder LinkedList is a subset of the
mAnimations hashset (omitting any animations that are hidden due to
content-visibility).  This patch corrects one case where we were incorrectly
inserting an animation into the linked list when it wasn't present in the
hashset (because the animation had completed).

This patch also adds some documentation to mention this invariant, and some
assertions to enforce it in several places.

Differential Revision: https://phabricator.services.mozilla.com/D173333
2023-03-23 04:41:12 +00:00
Daniel Holbert
42d84e917d Bug 1822907 part 1: Make some documentation and naming cleanups related to content-visibility and AnimationTimeline. r=hiro
Specifically:
 - We had an obsolete reference to an array (which is now a LinkedList).
 - We had an assertion which could benefit from a message for clarity.
 - We had an arg whose name was missing the standard "a" prefix.

Differential Revision: https://phabricator.services.mozilla.com/D173332
2023-03-23 04:41:11 +00:00
Andi-Bogdan Postelnicu
fa5d4cca1f Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 11:35:33 +00:00
Andi-Bogdan Postelnicu
10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
0b692b5a96 Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 09:27:57 +00:00
Andi-Bogdan Postelnicu
a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
Kershaw Chang
5e58575e28 Bug 1809843 - Skip Failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,valentin,sgalich,robwu
Differential Revision: https://phabricator.services.mozilla.com/D171842
2023-03-21 09:09:58 +00:00
Boris Chiou
c2fa109db0 Bug 1821416 - Drop the element property usage from ScrollTimelineSet. r=emilio
We are doing the following things here:
1. Rename ScrollTimelineSet to ProgressTimelineScheduler because this
   class is used to schedule animations with progress timelines, including
   scroll timelines and view timelines.
2. Drop the element property usage and let ElementAnimationData store
   ProgressTimelineScheduler.
3. We avoid using the generated content in ScrollTimeline::Scroller.
   Instead, we use a pair of Element and PseudoStyleType to represent
   ScrollTimeline::Scroller.

We hit the assertion because the generatd content may change and so we
shouldn't use it as the ScrollTimeline::Scroller.

Differential Revision: https://phabricator.services.mozilla.com/D172610
2023-03-16 20:00:00 +00:00
Marian-Vasile Laza
ee72efd1e9 Backed out 5 changesets (bug 1809843) for causing Cargo related build bustages. CLOSED TREE
Backed out changeset 5c494680f448 (bug 1809843)
Backed out changeset 02742b38edab (bug 1809843)
Backed out changeset 2b9b32ca8294 (bug 1809843)
Backed out changeset 56631cb02ae6 (bug 1809843)
Backed out changeset 37e35a60a71f (bug 1809843)
2023-03-13 13:53:26 +02:00
Kershaw Chang
a60df34ad0 Bug 1809843 - Skip Failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,valentin,sgalich,robwu
Differential Revision: https://phabricator.services.mozilla.com/D171842
2023-03-13 11:12:33 +00:00
Boris Chiou
95a2a27769 Bug 1814786 - Part 5: Factor out the conversion between (Element, PseudoStyleType) pair and Element. r=hiro
The conversions between an element (including generated content) and the
pair of element and pseudo style type are used frequently, so perhaps it'd
better to factor them out. This patch only moves functions into
AnimationUtils.

FIXME: I suspect Gecko_UpdateAnimations() should early return for the pseudo
elements which we don't support for animations. However, this may cause
some test failures, so we keep the original implementation for now.

Differential Revision: https://phabricator.services.mozilla.com/D159111
2023-03-07 23:57:55 +00:00
Boris Chiou
d548aea8a2 Bug 1814786 - Part 4: Introduce TimelineCollection and TimelineManager. r=emilio
Just like how we handle the CSSAnimation and CSSTransition. We use
TimelineCollection to store the named progress timeline objects created
by scroll-timeline-name and view-timeline-name, and reuse
ElementAnimationData to handle the life time of TimelineCollection.

Also, introduce TimelineManager to update timelines generated by CSS.

We add one test which mutates the scroll-timeline-axis to make sure we
restyle the animations associtated with the existing timelines. It will
be passed when we start to use the new framework, in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D169271
2023-03-07 23:57:54 +00:00
Boris Chiou
6a068ff577 Bug 1814786 - Part 3: Fix build errors in linux64-plain/hybrid when including ScrollTimeline.h. r=emilio
ScrollTimeline is inherited from AnimationTimeline, which uses
`nsTHashSet<nsRefPtrHashKey<dom::Animation>>`.
Therefore, its constructor have to know the size of dom::Animation.

In order to avoid build errors in plain mode when adding new files which
include ScrollTimeline.h or AnimationTimeline.h, we have to move its
constructor into the cpp file to make the forward declaration
of dom::Animation work.

Differential Revision: https://phabricator.services.mozilla.com/D170264
2023-03-07 23:57:54 +00:00
Boris Chiou
0d72e5e0e2 Bug 1814786 - Part 2: Factor out the tree traversal part into nsAnimationManager. r=emilio
So we can reuse it for view timeline. Also, tweak the function name a
little bit so it'd be easier to use template functions.

Differential Revision: https://phabricator.services.mozilla.com/D169270
2023-03-07 23:57:53 +00:00
Boris Chiou
ba97b6ee9c Bug 1814786 - Part 1: Make each scroll timeline be a different object. r=emilio
Per spec issue: https://github.com/w3c/csswg-drafts/issues/8204,
we make each annoymous scroll timeline is a different object. However,
for named progress timeline, i.e. scroll-timeline property, we still
have to reuse it. We will introduce a different way to achieve it in the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D169269
2023-03-07 23:57:53 +00:00
Tiaan Louw
c8476cb106 Bug 1817641 - Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colors r=emilio
Computed color values will not be in the correct format, closer to the
one specified by the author.  This also means that colors accross the
code are stored now as AbsoluteColor or StyleAbsoluteColor.  This allows
color space/gamut information to be available for use.

Some animation related test failures had to be changed, because colors
now has greater precision.  Animated a color now causes a lot more
animation updates, which was not initially expected.  See the bug for
discussion.

Differential Revision: https://phabricator.services.mozilla.com/D171021
2023-03-07 11:28:15 +00:00
Emilio Cobos Álvarez
e56553284e Bug 1816915 - Tweak how we handle animation restyles on bind/unbind. r=hiro
Remove code on bind/unbind that requested a restyle on an unstyled
element, and that canceled that on an unbound element.

Instead, deal with detached nodes in EffectCompositor.

Tweak test restyles since we now expect one restyle as a result of the
initial composing of the animation that before happened eagerly.

Drive-by remove an unused test function in wpt (animationStartsRightNow
is not defined there anyways).

In practice, this makes it consistent with how we handle bind on
elements in shadow trees.

Differential Revision: https://phabricator.services.mozilla.com/D169932
2023-02-21 08:51:00 +00:00
Boris Chiou
81bb3e10ea Bug 1780865 - Make scroll timeline inactive if there is not scroll range. r=hiro
Per spec issue: https://github.com/w3c/csswg-drafts/issues/7401, and the
updated spec words:

If the source of a ScrollTimeline is an element whose principal box does
not exist or is not a scroll container, or if there is no scrollable overflow,
then the ScrollTimeline is inactive.

Besides, it seems we may have other issues related to Bug 1817051, so I
update the wpt to avoid testing the animation sampling times per frame.

Differential Revision: https://phabricator.services.mozilla.com/D169995
2023-02-16 01:25:56 +00:00
Emilio Cobos Álvarez
27dd98b647 Bug 1816915 - Clean up EffectSet APIs. r=firefox-animation-reviewers,boris
EffectSet::GetEffectSet seems rather redundant, use just EffectSet::Get
and tweak naming of similar APIs.

Differential Revision: https://phabricator.services.mozilla.com/D169931
2023-02-15 20:39:16 +00:00
Emilio Cobos Álvarez
6c32b964cd Bug 1807003 - Centralize animation data in slots. r=smaug,firefox-animation-reviewers,boris
This should both be faster and simpler. Also will allow us in the future
to animate more pseudos without having to add a gazillion properties.

I think we should try to clear more stuff (maybe the whole animation
data) on unbind, but that's a bit tangential.

Differential Revision: https://phabricator.services.mozilla.com/D169860
2023-02-15 14:12:33 +00:00
Emilio Cobos Álvarez
3d092ba60e Bug 1775062 - Implement ipdl reads without needing default ctors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D149743
2023-02-04 11:12:36 +00:00
Boris Chiou
933cc122ea Bug 1809005 - Make scroll-timeline-{name|axis} be a coordinating list property group. r=emilio
Named scroll progress timelines are declared in the coordinated value list
constructed from the longhands of the scroll-timeline shorthand property,
which form a coordinating list property group with scroll-timeline-name as
the coordinating list base property.

In the meantime, we also update its shorthand to match the current spec.

Differential Revision: https://phabricator.services.mozilla.com/D166596
2023-01-26 23:20:55 +00:00
Boris Chiou
28a7c5e6b7 Bug 1807966 - Avoid infinite output progress after applying the easing function. r=emilio
The output progress of easing functions could be inf or -inf, per spec,
https://drafts.csswg.org/css-easing-2/#output-progress-value.

But we should avoid using infinity to calculate interpolation or use
the infinite progress in Web Animations API, per the spec issue comments:
https://github.com/w3c/csswg-drafts/issues/8344#issuecomment-1399033481

Differential Revision: https://phabricator.services.mozilla.com/D167342
2023-01-23 22:02:23 +00:00
Adam Vandolder
868e17020e Bug 1809741 - commitStyles should enqueue attributeChanged for custom elements. r=edgar,emilio
Differential Revision: https://phabricator.services.mozilla.com/D166598
2023-01-19 01:55:03 +00:00
Emilio Cobos Álvarez
d54a0b79fb Bug 1810876 - Throttle animations in opacity: 0 root. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D167146
2023-01-19 01:01:52 +00:00
Boris Chiou
38556e307d Bug 1807685 - Rename scroll-linked (animations) to scroll-driven (excluding WPT tests). r=dholbert
The spec is still using `Scroll-linked`, so we exclude the change of WPT tests.
I believe WPT will get updates once the spec doc is renamed.

Differential Revision: https://phabricator.services.mozilla.com/D165914
2023-01-04 00:50:45 +00:00
Boris Chiou
f856c08cc3 Bug 1774505 - Preserve the progress of null timeline for print. r=hiro
We always use the document timeline of the cloned document, and clone the
paused animation with the preserved progress, even if the original
timeline is null.

Differential Revision: https://phabricator.services.mozilla.com/D164712
2022-12-16 02:28:02 +00:00
Andrew McCreight
ce28c41da0 Bug 1805931, part 2 - Automated removal of uses of ROOT and UNROOT CC macros. r=smaug
As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D164829
2022-12-15 19:45:01 +00:00
Nazım Can Altınova
ee86610605 Bug 1803751 - Make some marker fields searchable and bump the profile version r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D163714
2022-12-13 14:19:07 +00:00
Iulian Moraru
e7e2922cb1 Backed out changeset 27f8690ebc50 (bug 1803751) for causing xpcshell failures on test_feature_mainthreadio.js. CLOSED TREE 2022-12-12 17:43:23 +02:00
Nazım Can Altınova
0d5987410a Bug 1803751 - Make some marker fields searchable and bump the profile version r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D163714
2022-12-12 13:11:56 +00:00
Tom Ritter
161c40d6e2 Bug 1778510: Cut over AnimationEffect to new fine-grained TimerPrecision calls r=birtles
Depends on D151303

Differential Revision: https://phabricator.services.mozilla.com/D151304
2022-11-29 13:34:18 +00:00
Tom Ritter
8e9f7aca70 Bug 1778510: Add Timer Caller Type to AnimationTimeline r=birtles
Depends on D151301

Differential Revision: https://phabricator.services.mozilla.com/D151302
2022-11-29 13:34:17 +00:00
Tom Ritter
a6f9cf1d33 Bug 1778510: Use the Timer Caller Type in Animation's timestamp code r=birtles
Depends on D151300

Differential Revision: https://phabricator.services.mozilla.com/D151301
2022-11-29 13:34:17 +00:00
Tom Ritter
3949bc4d55 Bug 1778510: Add a Timer Caller Type to Animation r=birtles
This will be needed for the various Timestamp related
members of Animations.

Depends on D151299

Differential Revision: https://phabricator.services.mozilla.com/D151300
2022-11-29 13:34:17 +00:00
Botond Ballo
68c71a503c Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00