Граф коммитов

199 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou a6ce72cb76 Bug 1741255 - Don't put the scroll animations into PendingAnimationTracker. r=hiro
Basically, we use the current target scroll position as the ready time for
scroll animations, so we don't need to wait until it gets painted.

In fact, it's unclear whether do we need play/pause pending status for
scroll animations, so we choose the natural way for now, and this should
match other browsers' behaviors.

Note:
We avoid puting the scroll animation into PendingAnimationTracker
in PlayNoUpdate() and Pause(). However, we may still "try" to remove
scroll animations from PendingAnimationTracker in some APIs just in
case if those APIs change the animations from using DocumentTimeline to
using ScrollTimeline. They should be revisited once we expose
ScrollTimeline to JS.

Differential Revision: https://phabricator.services.mozilla.com/D132750
2021-12-15 09:54:43 +00:00
Masayuki Nakano 6123f0e0d8 Bug 1741148 - part 5: Make `nsINode::CompareDocumentPosition()` and `nsContentUtils::PositionIsBefore()` treat offset in DOM node with `Maybe<uint32_t>` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131338
2021-12-09 12:26:43 +00:00
Boris Chiou fcbeb1d2b0 Bug 1676791 - Part 5: Define the finite timeline and use it in Play() and Pause(). r=hiro
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.

Differential Revision: https://phabricator.services.mozilla.com/D131168
2021-12-08 01:16:30 +00:00
Boris Chiou 193a6c3d7a Bug 1676791 - Part 3: Implement the computation of timing. r=hiro
This patch focus on the timing computation of animation effects. We have
to compute the correct progress based on the scroll offsets. Now we
simplify the implementation only from 0% to 100%. The test cases will be
added in the last patch once we hook the scroll timeline to the CSS
animation.

Differential Revision: https://phabricator.services.mozilla.com/D129101
2021-12-08 01:16:29 +00:00
Simon Giesecke 9e50b6ee02 Bug 1678562 - Avoid including AnimationEffect.h in Animation.h. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D97743

Depends on D97740
2020-11-23 16:12:55 +00:00
Simon Giesecke 41c5b23a3e Bug 1676363 - Avoid including CycleCollectedJSContext.h and Promise.h from Animation.h. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96561

Depends on D96560
2020-11-23 16:10:57 +00:00
Hiroyuki Ikezoe 4205879729 Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
The machinery to report janked animations is;

1) Store the partial pre-rendered animation id and the Animation object in a
   hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
   call
4) Find the Animation object with the id in the hashtable and update the
   Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
   i.e. the Animation finished normally, the Animation's target element is
   changed, etc. etc., remove the Animation from the hashtable

Depends on D75731

Differential Revision: https://phabricator.services.mozilla.com/D75732
2020-07-05 11:45:01 +00:00
Brindusan Cristian 7f75410fd7 Backed out 9 changesets (bug 1324591) for linux build bustages on central on nsDisplayList.h.
Backed out changeset 75966ee1fe65 (bug 1324591)
Backed out changeset d6a01c6bc40e (bug 1324591)
Backed out changeset fef36ff2ea3d (bug 1324591)
Backed out changeset 4a4ae4bd95d1 (bug 1324591)
Backed out changeset 732804c83add (bug 1324591)
Backed out changeset 84657a3522fb (bug 1324591)
Backed out changeset e6c74ba41007 (bug 1324591)
Backed out changeset 8e6d4e9f5aa0 (bug 1324591)
Backed out changeset 6bc284863aff (bug 1324591)
2020-07-05 13:45:35 +03:00
Hiroyuki Ikezoe 92208a9c28 Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
The machinery to report janked animations is;

1) Store the partial pre-rendered animation id and the Animation object in a
   hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
   call
4) Find the Animation object with the id in the hashtable and update the
   Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
   i.e. the Animation finished normally, the Animation's target element is
   changed, etc. etc., remove the Animation from the hashtable

Differential Revision: https://phabricator.services.mozilla.com/D75732
2020-07-05 02:21:01 +00:00
Emily McDonough 0ee5c5dc91 Bug 1626794 - Add strong ref to document and MOZ_CAN_RUN_SCRIPT annotation to Animation::CommitStyles r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D75418
2020-05-17 20:47:37 +00:00
Emily McDonough fe1836fe09 Bug 1564128 part 1 - Add clone function for Animation and constructor for KeyframeEffect to copy properties but not the target. r=hiro
This is needed for copying animations from an original document to a static
clone during printing/print preview.

Differential Revision: https://phabricator.services.mozilla.com/D73139
2020-05-14 19:41:01 +00:00
Hiroyuki Ikezoe 34c6fd1e8c Bug 1636838 - Undef CurrentTime and define X11CurrentTime instead. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D74585
2020-05-11 19:34:02 +00:00
Brian Birtles 21f07a041a Bug 1459536 - Replace CSSAnimation interaction with animation-play-state with a simpler "once overridden always overridden" approach; r=boris
This corresponds to the approach outlined in https://github.com/w3c/csswg-drafts/issues/4822

Specifically:

* Calling play() / pause() always triggers the "animation play state is being
  overridden by the API" behavior (unless the method throws an exception).

* Setting the startTime or calling reverse() only triggers this override
  behavior if it results in a change between a playState that is paused and a
  playState that is not paused.

Differential Revision: https://phabricator.services.mozilla.com/D65100

--HG--
extra : moz-landing-system : lando
2020-03-04 00:38:30 +00:00
Brian Birtles 0d27d97f36 Bug 1459536 - Allow CSS animation properties to be overridden by replacing the effect; r=boris
Differential Revision: https://phabricator.services.mozilla.com/D65099

--HG--
extra : moz-landing-system : lando
2020-03-04 00:37:39 +00:00
Boris Chiou c68547f8f9 Bug 1612106 - Use NIGHTLY build flag to distinguish the writable/readonly Animation.timeline. r=birtles,bzbarsky
We only support writable Animation.timeline attribute on nightly
build, so use nightly build flag in WebIDL and Animation.h/cpp.
For the test expectations, we also use this build flag to skip them or
mark them as expected fail if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D63432

--HG--
extra : moz-landing-system : lando
2020-02-24 23:07:09 +00:00
Simon Giesecke 04ebbd504c Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/animation. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63135

--HG--
extra : moz-landing-system : lando
2020-02-20 15:33:28 +00:00
Boris Chiou 4f3959bfee Bug 1610981 - Eliminate usage of CSSPseudoElement from KeyframeEffect. r=birtles,smaug
Replace ElementOrCSSPseudoElement with Element and add PseudoElement (which is
a DOMString) into KeyframeAnimationOptions and KeyframeEffect.

Differential Revision: https://phabricator.services.mozilla.com/D62667

--HG--
extra : moz-landing-system : lando
2020-02-18 20:44:14 +00:00
Mirko Brodesser f7921bb4e3 Bug 1593222: part 2) Move `nsNodeUtils::GetTargetForAnimation` to `Animation` class. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51607

--HG--
extra : moz-landing-system : lando
2019-11-05 14:23:13 +00:00
Brian Birtles 65f06d35fe Bug 1253476 - Implement Animation.commitStyles; r=boris,emilio,bzbarsky,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30327

--HG--
extra : moz-landing-system : lando
2019-05-20 06:04:23 +00:00
Brian Birtles cb3c791020 Bug 1253476 - Implement Animation::Persist; r=boris,bzbarsky
https://drafts.csswg.org/web-animations-1/#dom-animation-persist

Differential Revision: https://phabricator.services.mozilla.com/D30325

--HG--
extra : moz-landing-system : lando
2019-05-20 05:22:22 +00:00
Brian Birtles 5b145a6de4 Bug 1253476 - Add remove events; r=boris,bzbarsky
This patch introduces the machinery for dispatching remove events but does not
actually cause removing to do anything to the output of the animation beyond
updating its replaceState member.

The expected behavior is defined in:

  https://drafts.csswg.org/web-animations-1/#removing-replaced-animations

And the corresponding IDL members are defined in:

  https://drafts.csswg.org/web-animations-1/#animation
  https://drafts.csswg.org/web-animations-1/#enumdef-animationreplacestate

Tests for these events are added in the next patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D30322

--HG--
extra : moz-landing-system : lando
2019-05-20 05:48:29 +00:00
Brian Birtles 5fe06d1f3c Bug 1253476 - Use in-class member initializers in Animation.h; r=hiro
The in-class initializers are easier to maintain since you don't have to try and
match them up with the constructor initializer list (including matching the
order).

Differential Revision: https://phabricator.services.mozilla.com/D30317

--HG--
extra : moz-landing-system : lando
2019-05-20 05:20:07 +00:00
Brian Birtles 7a10d13a65 Bug 1541767 - Don't post animation restyles when unbinding an element; r=hiro
Currently we avoid posting animation restyles when unbinding an element by
removing the element from the document before deleting its animation
collections. As a result, when canceled animations go to post a restyle, they
can't find a pres context and give up posting a restyle.

However, this is problematic for two reasons:

* It means we can't remove such canceled animations from the
  PendingAnimationTracker if they are present there (i.e. it regresses the fix
  from bug 1223445).

* It means we can't post cancel events for such animations/transitions since we
  can't lookup the appropriate AnimationEventDispatcher.

In the next patch in this series we will change that order to fix the above
problems but before we do that, we need to introduce another mechanism to make
sure that we don't post restyles when unbinding an element or else we will
regress bug 1396041.

This patch does that by introducing a flag which causes us to not post restyles
when we are doing DOM surgery. For all other cases we actually _do_ need to post
restyles in order to update the style correctly.

Without this patch, layout/style/crashtests/1396041.html would fail after
applying the next patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D28021

--HG--
extra : moz-landing-system : lando
2019-04-18 06:49:25 +00:00
Brian Birtles d877551208 Bug 1541767 - Drop Animation::CancelNoUpdate; r=hiro
CancelNoUpdate actually can and does trigger restyles via its call to
KeyframeEffect::NotifyAnimationTimingUpdated so at very least its name is wrong.

Furthermore, we actually want canceling to trigger restyles in most cases since
when an animation is canceled we need to trigger a subsequent restyle to apply
the (no-longer-animated) result.

This wasn't necessary when CancelNoUpdate was first introduced but since then we
have introduced the Servo style engine where we use a separate traversal to
apply the result from creating/deleting/modifying animations.

This change will mean that we now trigger a "layer" restyle when canceling an
animation when we previously didn't. That, however, seems more correct if
anything.

This patch also makes CancelFromStyle no longer virtual since it doesn't seem
necessary anymore (perhaps because we now point to the concrete type:
CSSAnimation/CSSTransition from nsAnimationManager/nsTransitionManager whereas
previously we didn't).

Differential Revision: https://phabricator.services.mozilla.com/D28019

--HG--
extra : moz-landing-system : lando
2019-04-18 06:24:52 +00:00
Boris Chiou 97ae508f2d Bug 1526850 - Part 2: Let FindAnimationsForCompositor take nsCSSPropertyIDSet. r=hiro
We use DisplayItemType as the input of HasAnimationsForCompositor, and
nsCSSPropertyIDSet as the input of GetAnimationsForCompositor.

The caller of HasAnimationsForCompositor just wants to check if there is
any compositor animation for a display item, so we can replace it by the
display item, and get the properties from this display item.

However, the caller of GetAnimationsForCompositor may use a subset of
transform-like properties for getting scale factors, or use all the
transform-like properties for sending all transform animations to the
compositor thread.

Depends on D19630

Differential Revision: https://phabricator.services.mozilla.com/D19628

--HG--
extra : moz-landing-system : lando
2019-03-01 21:13:03 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Brian Birtles 9b742685c0 Bug 1518982 - Don't register animations with playbackRate == 0 with a timeline; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D16153

--HG--
extra : moz-landing-system : lando
2019-01-10 06:56:09 +00:00
Brian Birtles 3ce2f154a0 Bug 1518374 - Remove obsolete comment in Animation.h about kNoIndex; r=hiro
As of bug 1203009 / changeset 37b6deedaab6 and per spec, we no longer reset the
animation index when an Animation re-enters the idle state and kNoIndex is no
longer defined.

Depends on D15898

Differential Revision: https://phabricator.services.mozilla.com/D15899

--HG--
extra : moz-landing-system : lando
2019-01-08 06:41:34 +00:00
Brian Birtles 2c202a7e3c Bug 1518374 - Shuffle definitions in Animation.h; r=hiro
This arranges related declarations by function as opposed to trying to
distinguish between functions that are Web-facing and those that are not.

The order still corresponds to the order in the spec[1] however.

[1] https://drafts.csswg.org/web-animations-1/#the-animation-interface

Differential Revision: https://phabricator.services.mozilla.com/D15898

--HG--
extra : moz-landing-system : lando
2019-01-08 06:47:43 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Brian Birtles 928d88aabb Bug 1433705 - Rename GetCurrentTime to GetCurrentTimeAsDuration; r=hiro
To avoid having to always work around conflicts with winbase.h.

Differential Revision: https://phabricator.services.mozilla.com/D13951

--HG--
extra : moz-landing-system : lando
2018-12-06 22:16:48 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Hiroyuki Ikezoe 852cca0069 Bug 1506988 - Move IsMatchForCompositor to KeyframeEffect. r=birtles
So that we can use for KeyframeEffect::GetPropertiesForCompositor().

Depends on D12396

Differential Revision: https://phabricator.services.mozilla.com/D12397

--HG--
extra : moz-landing-system : lando
2018-11-22 04:01:10 +00:00
Olli Pettay 57b81277a0 bug 1483963, cache the index of a child node when ordering animations for event dispatch, r=hiro,ehsan
--HG--
extra : rebase_source : f98586625b199e7b2d0eb7db8dc9c1c5235289fe
2018-09-05 00:31:57 +03:00
Olli Pettay a6fa8c7c32 Bug 1488279 - Reorder the member variables of Animation, r=hiro
--HG--
extra : rebase_source : efe0da082de85c58edb68e030837bceae7faf7d5
2018-09-04 00:58:15 +03:00
Hiroyuki Ikezoe dce2768ffd Bug 1474247 - Factor out Animation::ReschedulePendingAnimations and make it public. r=birtles
The function will be used in the case of KeyframeEffect::SetTarget too.

MozReview-Commit-ID: G6ipjxaIJsW

--HG--
extra : rebase_source : 609fa17d698612df21d9cac469e6997582dcca69
2018-07-12 17:05:13 +09:00
Hiroyuki Ikezoe 1609fd1ef0 Bug 1472900 - Use timestamp associated with the timeline for animation cancel events. r=birtles
Before this change, the test in this commit fails.  The received events order
is;

 1) cancel
 2) transitioncancel
 3) transitionstart
 4) finish

MozReview-Commit-ID: 8liTFXime6e

--HG--
extra : rebase_source : 3c68ef330b1f263afa2fad9670a30b351b8dbf28
2018-07-05 06:19:12 +09:00
Hiroyuki Ikezoe 8b30a3dc7b Bug 1354501 - Dispatch web animation events at the same time when CSS animations/transitions events are dispatched. r=birtles
MozReview-Commit-ID: u7lWtAF8Ml

--HG--
extra : rebase_source : 6ce807bc253706483960dade2f2c926fa9821460
2018-07-03 11:05:23 +09:00
Hiroyuki Ikezoe 1c47aa1edf Bug 1354501 - Factor out calculations for interval start/end times. r=birtles
MozReview-Commit-ID: H9iXX9VLXLr

--HG--
extra : rebase_source : 736d304858cd0a2c5953f9986dd161ebd21c8099
2018-07-03 09:25:02 +09:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Hiroyuki Ikezoe cdbb8485ee Bug 1466990 - s/StartOnNextTick/TriggerOnNextTick/ in comments. r=birtles DONTBUILD
The function was renamed in bug 1109390.

MozReview-Commit-ID: Bb7pDRXdhvv

--HG--
extra : rebase_source : 8a46e78ef6b78831bd6e7bf60f3d0b05440a3512
2018-06-06 09:53:13 +09:00
Brian Birtles f8c518344a Bug 1456394 - Rename AnimationEffectReadOnly to AnimationEffect; r=bz,hiro
MozReview-Commit-ID: 8jzJiCWt5vs

--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffect.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffect.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffect.webidl
extra : rebase_source : 2bd6490fe9be47cfb760bda81a63c33ba0b0397d
2018-05-07 11:15:16 +09:00
Brian Birtles 3184f30162 Bug 1456394 - Merge KeyframeEffectReadOnly and KeyframeEffect; r=bz,hiro
MozReview-Commit-ID: FvTMGjxfRXk

--HG--
extra : rebase_source : 8f7fd0903c9ca2f545dce2633eb797345a7517f8
2018-05-07 11:08:59 +09:00
Hiroyuki Ikezoe 1a43163be4 Bug 1443427 - Don't flush throttled animations in Animation::FlushStyle(). r=birtles
Animation::FlushStyle() gets called only for CSS animations/transitions'
playState changes in JS or ready Promise for CSS animations.  In either case
throttled animation state, which is, to be precise, transformed position or
opacity value on the compositor, doesn't affect those results.

The first test case for CSS animations and the first test case for CSS
transitions in this patch fail without this fix.

MozReview-Commit-ID: EVym4qputL4

--HG--
extra : rebase_source : 12524c7db1d59da69687bb123fc65ad4301f5527
2018-04-11 18:01:14 +09:00
Hiroyuki Ikezoe 71f08a9c46 Bug 1412716 - De-templatize Animation::ComposeStyle and relevant stuff. r=emilio
MozReview-Commit-ID: AoDRzqG8hET

--HG--
extra : rebase_source : 4de6b09e38373117a7268aaefd83acdb82a67741
2018-04-09 20:15:59 +09:00
Brian Birtles ee9982905f Bug 1420320 - Drop dom.animations-api.pending-member.enabled pref; r=bz,hiro
This pref was introduced in case we encountered compatibility issues from
changing the return value of Animation.playState (bug 1412765). Now that the
change to Animation.playState has shipped to release channel without any known
problems we should drop this pref.

MozReview-Commit-ID: CwMWRRtIf6u

--HG--
extra : rebase_source : b26c59a51880406c2b94baad8da2eafeb3ae3202
2018-03-16 12:49:55 +09:00
Hiroyuki Ikezoe 6f36308ec8 Bug 1443423 - Drop Animation::PauseNoUpdate(). r=birtles
CSSTransition still uses PlayNoUpdate().

MozReview-Commit-ID: 5RHSXwaKYV2

--HG--
extra : rebase_source : f8edbe2ebf02fbc7e77f99f0064b2a65a5ae3cd4
2018-03-07 11:48:35 +09:00
Olli Pettay 2439836b37 Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Csoregi Natalia 1fd0486e23 Backed out 7 changesets (bug 1193394) for browser-chrome failures on browser_ext_popup_background.js. CLOSED TREE
Backed out changeset 9683f24ff8ec (bug 1193394)
Backed out changeset 0e7140a7c841 (bug 1193394)
Backed out changeset a0e26f6b2784 (bug 1193394)
Backed out changeset 29e1fceaf48d (bug 1193394)
Backed out changeset b8632bbbd273 (bug 1193394)
Backed out changeset a54ef2d8f896 (bug 1193394)
Backed out changeset 55c94c05c57f (bug 1193394)
2018-03-01 16:29:02 +02:00
Olli Pettay b7726493fb Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00