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

65 Коммитов

Автор SHA1 Сообщение Дата
Brian Birtles f4bdb4f46c Bug 1171817 part 5 - Add a sequence number member to Animations; r=dbaron
Web Animations defines Animations as having a globally unique sequence number
for the purpose of prioritization:

  http://w3c.github.io/web-animations/#animation-sequence-number

As of the writing of this patch, the spec says the sequence number is updated
when the Animation is created. This is problematic and I have proposed that
actually this should be updated from each transition from idle:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0054.html

This doesn't seem to have met any opposition so I will update the spec to
reflect this soon.

This patch implements the behavior of updating the sequence number on each
transition from idle.

To make sure we perform this on each change to timing this patch removes
a couple of instances of early returns to ensure that UpdateTiming is called.

The current maximum sequence number is simply a class static and we make no
attempt to deal with wraparound. This is because we only update this number when
an animation transitions from idle which only happens when an animation is
created or script calls cancel() followed by play() on the animation. Supposing
that across all content this happenned an unlikely 1 billion times a second we
still wouldn't exhaust the range of the unsigned 64-bit int for about 585 years.

We'd like to make kUnsequenced be zero and make the static represent the
current maximum. This would probably be easier to understand and recognize in
a debugger. However, later in this patch series we will make CSS animations and
CSS transitions override this sequencing behavior. If we define kUnsequenced
to be zero and they accidentally assign zero as an actual sequence number then
they'll run into trouble. To avoid that we set kUnsequenced to UINT64_MAX.

--HG--
extra : commitid : DMw8uKjg4Hz
extra : rebase_source : 9e98b3346f0297efce3ecfa0b2dd8a9c13075dca
2015-06-09 11:13:53 +09:00
Brian Birtles 2378ae7083 Bug 1171817 part 4 - Add const version of AsCSSAnimation/AsCSSTransition methods; r=dbaron
These will be needed for sorting animations and transitions in a const-correct
fashion.

--HG--
extra : commitid : BhuFfkAvse7
extra : rebase_source : a97039f06b9f257ccb9b6aa206653d6b5d5d43d4
2015-06-09 11:13:53 +09:00
Brian Birtles 916a2b1a0e Bug 1171817 part 2 - Add CSSAnimation::GetOwningElement; r=dbaron
In order to sort CSS animation objects correctly, we need to know which
element's animation-name property they appear in, if any. Normally that's
simply the target element of the animation's keyframe effect but it can differ
in the following cases:

1) When script modifies a CSSAnimation's effect to target a different element
   (or simply removes the effect altogether). In this case we use the
   *owning* element to determine the priority of the animation, not the target
   element.

   This scenario does not yet occur (bug 1049975).

2) When script creates a CSSAnimation object using the CSSAnimation constructor.
   In this case, the owning element should be empty (null) and we should
   determine the priority of the animation in the same way as any other
   Animation object.

   Again, this is not yet supported (or even specced) but will be eventually.

3) When script holds a reference to a CSSAnimation object but then updates the
   animation-name property such that the animation object is cancelled. In this
   case the owning element should be cleared (null) so we know to not to try and
   sort this with regard to any animation-name property.

   This is possible using code such as the following:

     elem.style.animation = 'a 5s';
     var a = elem.getAnimations()[0];
     elem.style.animation = 'b 5s';
     a.play(); // Bring a back to life
     document.timeline.getAnimations();
     // ^ At this point we need to know how to sort 'a' and 'b' which depends
     // on recognizing that a is no longer part of an animation-name list.

Until we implement bug 1049975, we could support sorting animations without
adding the reference to the owning element by setting a flag on the CSSAnimation
object but (having tried this) it turns out to be cleaner to just introduce this
reference now, particularly since we know we will need it later.

Note that we will also need this information in future to dispatch events to the
correct element in circumstances such as (1) once we separate updating timing
information (including events) from applying animation values.

--HG--
extra : commitid : 8o9bf6l7kj7
extra : rebase_source : 391a4e8769cc96584ebd625d4b1d0e873373fd41
2015-06-09 11:13:53 +09:00
Brian Birtles 3c2d6db2da Bug 1179111 part 5 - Remove Name() methods; r=jwatt
--HG--
extra : source : 22cafa2fd162a3cbe9af7fd13a92fd82cd3a2315
2015-07-01 15:19:04 +09:00
Brian Birtles cc59f02cc9 Bug 1178186 part 1 - Add CSSAnimation and CSSTransition interfaces; r=smaug
--HG--
extra : source : 1e1ccffd51b824fb6b229def4ddb7cb1d8889bb6
2015-06-30 10:00:39 +09:00
Carsten "Tomcat" Book 0a19d00b4f Backed out changeset 1e1ccffd51b8 (bug 1178186) for suspicion of causing bc2 test failures on OSX browser_bug427559.js 2015-07-07 14:22:33 +02:00
Carsten "Tomcat" Book 297c2b6a58 Backed out changeset 22cafa2fd162 (bug 1179111) 2015-07-07 14:21:33 +02:00
Brian Birtles cd06229252 Bug 1179111 part 5 - Remove Name() methods; r=jwatt
--HG--
extra : commitid : JT0oaGODGja
extra : rebase_source : e0ff11f1f482599e5e2b7b0eac6cfbb71fd0e34b
2015-07-01 15:19:04 +09:00
Brian Birtles e298fe6b44 Bug 1178186 part 1 - Add CSSAnimation and CSSTransition interfaces; r=smaug
--HG--
extra : commitid : K0U17zTMtAz
extra : rebase_source : e3b2dc3c503144763efe41ef71b9dc3793b3172f
2015-06-30 10:00:39 +09:00
Brian Birtles e293c228f5 Bug 1166164 part 6 - Make pausing from idle set the current time; r=jwatt, r=smaug
As proposed:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0013.html (item g)

And agreed upon here:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0031.html

--HG--
extra : rebase_source : baca2fa6b9ba94afb1bb3e072e33729774a34f19
extra : histedit_source : 8348f3e8029017dbe380e30dbfc2f66b201beaf0
2015-05-19 14:55:26 +09:00
Brian Birtles f73f30be29 Bug 1166164 part 5 - Make play() throw when it should seek to the end of an infinite effect; r=jwatt, r=smaug
--HG--
extra : rebase_source : dade110e0d071727ed5bfdb694415ae7980f4467
extra : histedit_source : 1d87ee7db7fd0ec9670fff546e4654fa07bf4f31
2015-05-19 14:00:48 +09:00
Brian Birtles 6198ebeea8 Bug 1166164 part 4 - Make finished promise not resolve when paused; r=jwatt
As resolved, https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0038.html
item 2.

--HG--
extra : rebase_source : 9f321446c9cd9ac4dcdefa4ca441ac8f3e76fc8f
2015-05-19 08:51:13 +09:00
Brian Birtles f28d7941d9 Bug 1166164 part 2 - Make UpdateFinishedState take a non-defaulted enum; r=jwatt
This is much easier to read at call sites and prevents accidentally using the
default value when another value might be more suitable.

--HG--
extra : rebase_source : b1c05d8bf7b97744e53f2ecc676561f3a4a80888
2015-05-11 17:17:06 +09:00
Brian Birtles 87aaa8fc5f Bug 1164330 - Rename time fraction to (iteration) progress; r=jwatt
--HG--
extra : rebase_source : ca36d4d5dab2d08d42c7daa1e6778cda1408f465
2015-05-13 13:57:35 +09:00
Andrew McCreight 023db96fd8 Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Brian Birtles a606228cd8 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly. r=smaug 2015-04-30 09:06:43 -04:00
Carsten "Tomcat" Book b05d97c166 Backed out changeset 1b5fc672f0d4 (bug 1159082) for B2G ICS Emulator opt R6 test failures on a CLOSED TREE
--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffectReadonly.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffectReadonly.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffectReadonly.webidl
2015-04-30 13:15:04 +02:00
Brian Birtles 4fb166f6b2 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly; r=smaug
--HG--
rename : dom/animation/AnimationEffectReadonly.cpp => dom/animation/AnimationEffectReadOnly.cpp
rename : dom/animation/AnimationEffectReadonly.h => dom/animation/AnimationEffectReadOnly.h
rename : dom/webidl/AnimationEffectReadonly.webidl => dom/webidl/AnimationEffectReadOnly.webidl
extra : rebase_source : 5fb31684bf494a57e208d0cfbbc76f65b502fc0e
2015-04-28 10:16:45 +09:00
Brian Birtles 063783952d Bug 1157989 part 4 - Make method comment style consistent; r=jwatt 2015-04-27 10:05:47 +09:00
Brian Birtles 8625e1337a Bug 1157989 part 3 - Make LimitBehavior enum a scoped enum; r=jwatt 2015-04-27 10:05:47 +09:00
Brian Birtles fb3e1108d4 Bug 1157989 part 2 - Make Silently* methods protected; r=jwatt
These methods aren't part of the public API.
2015-04-27 10:05:46 +09:00
Brian Birtles 9104378d5d Bug 1157989 part 1 - Line up methods in dom/animation/Animation with the API; r=jwatt 2015-04-27 10:05:46 +09:00
Brian Birtles 012ebba32c Bug 1150807 part 3 - Call PostUpdate from Cancel; r=jwatt
This patch makes Cancel() call PostUpdate which clobbers certain state in style
so that animated style is correctly flushed when an animation is cancelled.

The main difficulty with this is that we *don't* want to call this when we're
cancelling an animation as a result of a style update or else we'll trigger
needless work. The pattern elsewhere has been to define a *FromStyle() method
for this case (e.g. CSSAnimation::PlayFromStyle, PauseFromStyle). This isn't
ideal because there's always the danger we will forget to call the appropriate
*FromStyle method. It is, however, consistent. Hopefully in bug 1151731 we'll
find a better way of expressing this.
2015-04-27 08:53:19 +09:00
Brian Birtles b34276b816 Bug 1150807 part 2 - Expose Animation::Cancel in WebIDL; r=smaug 2015-04-27 08:53:18 +09:00
Jonathan Watt 7646a6a26c Bug 1150064, part 1 - Implement the Animation.finish() method. r=birtles, r=smaug 2015-04-16 17:15:20 +01:00
Brian Birtles 2cfdd7ac06 Bug 1154615 part 7 - Rename CSSAnimationPlayer and CSSTransitionPlayer; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles 8f5fbac8a9 Bug 1154615 part 5 - Rename AnimationPlayerCollection to AnimationCollection; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles bd4c87f07a Bug 1154615 part 4 - Rename references to players in dom/animation; r=jwatt
This patch does not, however,  update references to
AnimationPlayerCollection/CSSTransitionPlayer etc. which we will fix when we get
to layout/style.
2015-04-21 10:22:09 +09:00
Brian Birtles 4f7bf25c27 Bug 1154615 part 2 - Rename PendingPlayerTracker to PendingAnimationTracker; r=jwatt
This patch also updates the method names on PendingAnimationTracker but leaves
a number of local variables which will be fixed in a subsequent patch.

--HG--
rename : dom/animation/PendingPlayerTracker.cpp => dom/animation/PendingAnimationTracker.cpp
rename : dom/animation/PendingPlayerTracker.h => dom/animation/PendingAnimationTracker.h
2015-04-21 10:22:09 +09:00
Brian Birtles 5c7929fd2a Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
This patch is a fairly minimal rename of the AnimationPlayer interface. It
leaves a bunch of local variables and helper classes still using the word
"player". These will be addressed in subsequent patches that don't require DOM
peer review.

--HG--
rename : dom/animation/AnimationPlayer.cpp => dom/animation/Animation.cpp
rename : dom/animation/AnimationPlayer.h => dom/animation/Animation.h
rename : dom/webidl/AnimationPlayer.webidl => dom/webidl/Animation.webidl
2015-04-21 10:22:09 +09:00
Brian Birtles 63e2382338 Bug 1153734 part 2 - Rename Animation to KeyframeEffectReadonly; r=smaug
We define KeyframeEffectReadonly in KeyframeEffect.cpp since Web Animations also
defines KeyframeEffect and when we come to implement that I expect we'll define
it in the same class, maybe even using the same object.

This patch also adds a few missing includes in places where
KeyframeEffectReadonly is used so that we're not just cargo-culting it in.

--HG--
rename : dom/animation/Animation.cpp => dom/animation/KeyframeEffect.cpp
rename : dom/animation/Animation.h => dom/animation/KeyframeEffect.h
rename : dom/animation/test/css-animations/test_animation-name.html => dom/animation/test/css-animations/test_effect-name.html
rename : dom/animation/test/css-animations/test_animation-target.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-transitions/test_animation-name.html => dom/animation/test/css-transitions/test_effect-name.html
rename : dom/animation/test/css-transitions/test_animation-target.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/webidl/Animation.webidl => dom/webidl/KeyframeEffect.webidl
2015-04-15 08:48:21 +09:00
Brian Birtles d5b5205359 Bug 1153734 part 1 - Remove AnimationEffect; r=smaug
Most of this is fairly obvious. However, the addition of 'override' to
ElementPropertyTransition::Name() is not strictly necessary. It was simply added
because while making these changes I accidentally dropped the 'virtual' keyword
from the method in the superclass and the compiler didn't complain. Adding this
will hopefully make it harder to create the same bug in the future.

--HG--
rename : dom/animation/test/css-animations/test_animation-effect-name.html => dom/animation/test/css-animations/test_animation-name.html
rename : dom/animation/test/css-transitions/test_animation-effect-name.html => dom/animation/test/css-transitions/test_animation-name.html
2015-04-15 08:48:20 +09:00
Brian Birtles 121b831ff7 Bug 1122414 part 2 - Return the transitionProperty from Animation.name for CSS transitions; r=jwatt
This is a bit awkward. We lazily set mName to the transition property and then
return it. The reasons for this approach are:

* We don't really want to eagerly fill in mName for all transitions since in
  99% of cases we'll never use it and this will lead to wasted allocations.

* The signature of Name() returns a const nsString reference. This is because
  Name() is used when building CSS Animations (to compare different copies of
  the same animation when updating). For that case we don't really want to
  generate unnecessary copies of nsString objects so we return a reference.
  However, that means for transitions as well we need to return a reference so
  we can't just generate a temporary string on-demand.

  As a result we also have to const-cast ourselves so we can update the mName
  member. We could make mName mutable but seeing as it's only set once, the
  const_cast seems more appropriate.
2015-04-14 09:13:27 +09:00
Markus Stange ab28a4f0c8 Bug 1151346 - Make ActiveLayerTracker::IsOffsetOrMarginStyleAnimated respect CSS animations. r=roc
--HG--
extra : rebase_source : a3594dcb2d8733b6f545c6cf713178ea0d953889
2015-04-05 22:53:51 -04:00
L. David Baron a7bdf3d859 Bug 847287 patch 6 - Set mWinsInCascade for CSS Animations. r=birtles
This is the main patch for the bug; it makes us use the mechanism added
in bug 1125455 to avoid sending animations that aren't currently
applying to the compositor.

Patch 7 is needed to make this code rerun in all the cases where we need
to rerun it, though.
2015-03-31 15:05:54 -07:00
Tom Tromey 62331928fc Bug 1149194 - Don't use uninitialized value in ComputedTimingFunction::operator==. r=bbirtles 2015-03-30 09:44:00 -04:00
Jonathan Watt 2b22106122 Bug 1145246, part 3 - Update layout code for the rename of Animatable.getAnimationPlayers() to Animatable.getAnimations(). r=birtles 2015-03-20 18:20:49 +00:00
Brian Birtles 43d8f02ab6 Bug 1109390 part 17 - Add Animation::IsInPlay(); r=jwatt
This patch adds a method for testing if an animation is "in play" which is
a term defined in the Web Animations spec. This is in preparation for removing
some slightly redundant code in IsRunning and aligning better with the spec.
2015-03-27 17:54:39 +09:00
Brian Birtles a7e4fac5e7 Bug 1109390 part 16 - Update IsCurrent to take a player parameter; r=jwatt
In preparation for introducing IsInPlay (where "in play" is a term in the Web
Animations spec), this patch aligns the existing IsCurrent with the definition
in the spec that says an animation effect is only current if it is attached
to an animation (player in our current naming) that is not finished. In order
to ensure that we need to pass the animation/player into the method.

This actually changes the behavior of IsCurrent since now we will return false
for animations that are finished. As far as I can tell, all the call sites that
are requesting current animations should only be concerned with animations that
are actually running. If not, they need to be adjusted to look for animations
that are either current or in effect.
2015-03-27 17:44:38 +09:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
L. David Baron 40bd226b51 Bug 1125455 patch 5 - Add Animation::GetAnimationOfProperty. r=birtles
This is needed for patch 6.
2015-03-19 21:10:00 -07:00
L. David Baron 43ffda7be5 Bug 1125455 patch 1 - Add boolean for whether an animation of a property wins in the CSS cascade. r=birtles 2015-03-19 21:10:00 -07:00
Boris Zbarsky dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Carsten "Tomcat" Book 47fe95d629 Backed out 7 changesets (bug 1125455) for test failures in m1 test_animation-player-ready.html on a CLOSED TREE
Backed out changeset 8a316064caff (bug 1125455)
Backed out changeset ad326dbcbd03 (bug 1125455)
Backed out changeset 83dab9578e23 (bug 1125455)
Backed out changeset 5bd86c20cd02 (bug 1125455)
Backed out changeset 751177025dcb (bug 1125455)
Backed out changeset f60c5b4adf84 (bug 1125455)
Backed out changeset 326ef9a86c85 (bug 1125455)
2015-03-18 16:32:54 +01:00
L. David Baron 82ad97d447 Bug 1125455 patch 5 - Add Animation::GetAnimationOfProperty. r=birtles
This is needed for patch 6.
2015-03-18 07:35:30 -07:00
L. David Baron 065aeaa603 Bug 1125455 patch 1 - Add boolean for whether an animation of a property wins in the CSS cascade. r=birtles 2015-03-18 07:35:29 -07:00
Cameron McCormack 9d635d78ad Bug 1123523 - Part 9: Dispatch an nsIAnimationObserver notification when an animation is changed. r=birtles 2015-03-14 16:34:40 +11:00
L. David Baron 824c76c900 Bug 960465 patch 14 - Retain finished transitions until the next style change or until removed from transition-property. r=birtles
Note that this increases memory use for completed transitions since we
don't throw away the data when the transitions complete.  That said,
this matches what we do for CSS Animations, and it's needed (once we
switch to the new rules for starting transitions) to maintain the
invariant that unrelated style changes don't trigger transitions.

The storage issues could be optimized in the future if it turns out to
be a problem, but I think that's unlikely, given that we'll never store
more than one for any element+property combination.
2015-02-17 11:15:04 +13:00
Brian Birtles e6792d259c Bug 1078122 part 9 - Move queuing of CSS animation events to CSSAnimationPlayer; r=dholbert
This patch moves the code for queuing CSS animation events from
nsAnimationManager to CSSAnimationPlayer. In doing so, it also moves the
mLastNotification member and associated enum values.
2014-10-20 13:55:47 +09:00
Brian Birtles 5c994b7aac Bug 1078122 part 7 - Add method to Animation to get the target element and pseudo; r=dholbert 2014-10-20 13:55:47 +09:00