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

55 Коммитов

Автор SHA1 Сообщение Дата
Brian Birtles 0833cb3100 Bug 1025709 part 4 - Move EnsureStyleRuleFor from ElementTransitions and ElementAnimations to CommonElementAnimationData; r=heycam
Both ElementAnimations and ElementTransitions have an EnsureStyleRuleFor method.
The ElementAnimations version is a more general of the ElementTransitions one
with the exception that the ElementTransitions version checks for finished
transitions. This patch moves the code from ElementAnimations to
CommonElementAnimationData with one minor change: adding the checks for finished
transitions. The ElementTransitions version is removed.

Since the ElementAnimations version contains a second parameter, aIsThrottled,
callers of ElementTransitions must include this extra parameter. In
a subsequent patch we add an enum for this parameter to make call sites easier
to read.

The ElementAnimations version also sets the mNeedsRefreshes member so at the
same time we move mNeedsRefreshes to CommonElementAnimationData. Furthermore,
since the ElementAnimations version which we have adopted returns early if
mNeedsRefreshes is false, this patch ensures that when we call
EnsureStyleRuleFor from ElementTransitions::WalkTransitionRule, we set
mNeedsRefreshes to true first.

Another difference to account for is that the ElementTransitions version of
EnsureStyleRuleFor *always* sets mStyleRule (even if it doesn't add anything to
it) where as the ElementAnimations version only creates the rule when necessary
so we need to add a check to ElementTransitions::WalkTransitionRule that
mStyleRule is actually set before using it.
2014-06-20 12:39:24 +09:00
Brian Birtles 55944f4c7c Bug 1025709 part 3 - Move delay calculation to GetComputedTimingAt; r=heycam
Now that an animation's delay is part of AnimationTiming--the struct we pass to
GetComputedTimingAt--it makes sense to act on it in GetComputedTimingAt.

This also happens to bring the procedures here closer to the algorithm
definitions in Web Animations.

As part of this refactoring, this patch converts ElementAnimation::IsRunningAt
to use GetComputedTiming since the previous approach no longer works now that
GetLocalTimeAt (nee ElapsedDurationAt) no longer handles delays. This also
removes duplicated logic.

Also, previously ElapsedDurationAt would assert if called on a finished
transition since TimeDuration's - operator wouldn't like the null mStartTime.
This patch adds an assertion for this case to GetLocalTimeAt to ease debugging.
2014-06-20 12:39:24 +09:00
Brian Birtles 5c00d7239f Bug 1025709 part 2 - Add IsFinished() to ElementAnimation; r=heycam
One of the main differences in handling a list of transitions vs a list of
regular animations is that when we are dealing with a list of transitions we
need to check for transitions that have finished and are about to be discarded
but need to be retained temporarily to provide correct triggering of subsequent
transitions. Such transitions are marked as "removed sentinels" and are ignored
for most operations.

This patch moves the methods for setting and checking such transitions to the
base class ElementAnimation so that we can treat animations and transitions
alike without having to downcast or do obscure checks for mStartTime.IsNull()
(which equates to checking if the animation is a "removed sentinel" but is not
particularly clear).

In the process, this patch renames said methods to Is/SetFinishedTransition
since hopefully that is a little easier to understand at a glance.
2014-06-20 12:39:24 +09:00
Brian Birtles 5bb2caab0a Bug 1025709 part 1 - Move mDelay to AnimationTiming; r=heycam
This patch is the first part in preparing the way to merge ElementTransitions
with CommonElementAnimationData (which we'll eventually rename to something
nicer).

Here we move mTiming from CommonElementAnimationData to the AnimationTiming
struct. While this is not strictly necessary in order to do the later
refactoring it makes it simpler since it:

- Divides time calculation into calculation based on dynamic play state (the
  responsibility of animation players in Web Animations terms) and static
  author-specified timing parameters (a property of animations in Web Animations
  terms).
- In future we will probably put animations on the compositor during their
  delay phase so we will want the delay to be present in the AnimationTiming
  struct then.
- Makes AnimationTiming line up with the dictionary of the same name in Web
  Animations.
2014-06-20 12:39:23 +09:00
Birunthan Mohanathas bc0233fe47 Bug 1026535 - Fix mismatched class/struct tags. r=ehsan 2014-06-18 17:57:51 -07:00
Benoit Jacob 15b208d7f3 Bug 1027251 - Fix or whitelist dangerous public destructors in layout/ - r=dbaron 2014-06-18 22:28:59 -04:00
Neil Deakin 5504409f46 Bug 994117, add method to check if an element has current animations, r=bbirtles 2014-06-16 14:43:04 -04:00
Daniel Holbert 901461ddb7 Bug 1024084: Clean up forward declarations and #includes in nsFrameManager.h and nsFrameManagerBase.h. r=jwatt 2014-06-12 10:09:31 -07:00
Brian Birtles 3b4d311452 Bug 1004365 part 1 - Make active duration calculation handle zero-duration animations; r=dholbert
This patch also makes ElementAnimation::ActiveDuration a static method that
takes timing parameters as an argument. This is so that this method can be
used within ElementAnimations::GetComputedTimingAt (a static method) in a
future patch.

We could also make ActiveDuration() a method of AnimationTiming. I suspect
this logic belongs together in ElementAnimation however.

In a future patch we could also add the active duration to the ComputedTiming
struct which would simplify the only other place this is currently used
which is ElementAnimations::GetEventsAt.
2014-06-11 14:19:07 +09:00
Brian Birtles 05f227606f Bug 1007513 - Make AnimationEvent.elapsedTime report the actual time the animation has been running; r=dholbert
This patch implements the behavior proposed in:

  http://lists.w3.org/Archives/Public/www-style/2014May/0356.html
2014-05-30 09:45:39 +09:00
Brian Birtles 7b6c6a2ca1 Bug 1004871 part 11 - Move ElementAnimation members closer together for readability and packing; r=dholbert
Also shuffle the initialization of members in
nsAnimationManager::BuildAnimations to roughly match the order in which they
are declared (with the exception that mPlayState needs to be set before calling
IsPaused() which is used to set mPauseStart).
2014-05-28 16:51:50 +09:00
Brian Birtles 7265fd639b Bug 1004871 part 9 - Move ElementAnimations::GetPositionInIteration to ElementAnimation::GetComputedTimingAt; r=dholbert
This patch simply moves the code from ElementAnimations to ElementAnimation so
that it can later be used in transitions code and so we can later move
EnsureStyleRuleFor to ElementAnimation.
2014-05-28 16:51:50 +09:00
Brian Birtles efbd693128 Bug 1004871 part 6 - Make GetPositionInIteration return a ComputedTiming object; r=dholbert
This patch makes ElementAnimations::GetPositionInIteration return
a ComputedTiming object instead of just a time portion (time fraction).

Since the ComputedTiming object includes phase information, we can fix those
parts of EnsureStyleRule and GetEventsAt that were temporarily using the time
portion to guess if the animation might have finished or not.
2014-05-28 16:51:49 +09:00
Brian Birtles 39567485e3 Bug 1004871 part 5 - Add ComputedTiming data structure; r=dholbert
This patch adds a ComputedTiming struct for storing the results of calculating
the timing properties of an animation at a given sample time.
2014-05-28 16:51:49 +09:00
Brian Birtles 39ab9bf043 Bug 1004871 part 4 - Move FillsForwards/FillsBackwards to AnimationTiming; r=dholbert
This patch moves the FillsForwards/FillsBackwards methods previously defined on
ElementAnimations to the structure contain the fill mode: AnimationTiming. It
also changes GetPositionInIteration to use these methods.
2014-05-28 16:51:49 +09:00
Brian Birtles 7d5b54b2f6 Bug 1004871 part 2 - Add AnimationTiming struct, to encapsulate animation timing parameters; r=dholbert
Introduces a struct to store timing parameters for passing to
GetPositionInIteration. In future this struct is expected to be expanded to
include other timing parameters as well (based roughly on Web Animations'
"Timing" interface, hence the name AnimationTiming).
2014-05-28 16:51:49 +09:00
Brian Birtles 9c7f65de0d Bug 1004383 part 4 - Move mAnimations to CommonElementAnimationData; r=dbaron
As a result, transitions are now stored using a pointer to the base class,
mozilla::ElementAnimation. We downcast to a transition only when necessary. No
error-checking of the result of AsTransition is performed since we only ever
call it on the mAnimations member of ElementTransitions.
2014-05-15 08:38:37 +09:00
Brian Birtles 995090537a Bug 1004383 part 3 - Add ElementAnimation::AsTransition virtual method; r=dbaron
Add a method for downcasting from an ElementAnimation to an
ElementPropertyTransition (when the underlying object is an
ElementPropertyTransition).

This, unfortunately, adds a vtable to ElementAnimation but in the long term
I hope we will be able to isolate transition-specific code to a specific kind of
TransitionEffect that hangs off ElementAnimation and put the vtable on
AnimationEffect instead. (The AnimationEffect concept is part of the Web
Animations API.)
2014-05-15 08:38:37 +09:00
Brian Birtles 92e305760e Bug 1004383 part 2 - Rename StyleAnimation to ElementAnimation; r=dholbert
We currently have mozilla::StyleAnimation as well as nsStyleAnimation. This
patch renames StyleAnimation back to ElementAnimation.

Although ElementAnimation is very similar to ElementAnimations, in the near
future we expect to retire ElementAnimations and replace it with a common
AnimationSet-like structure that is covers the features of ElementAnimations and
ElementTransitions.
2014-05-15 08:38:37 +09:00
Brian Birtles 7595a03399 Bug 1004383 part 1 - Put StyleAnimation on the heap; r=dbaron
This patch takes StyleAnimation and makes it ref-counted heap object. This
should allow us to store StyleAnimation and its subclasses (transitions only
currently) in a consistent fashion (an array of base-class pointers).
Furthermore, this will be helpful if we want these things to be pointed to
from Javascript objects that may, for example, preserve their lifetime beyond
that of the element that currently owns them.

This patch also introduces a typedef for an array of refptrs to StyleAnimation
objects (and similarly for the subclass ElementPropertyTransition) to simplify
the code somewhat.
2014-05-15 08:38:37 +09:00
Brian Birtles 69ad5c898e Bug 880596 part 9 - Fix comment about mFlushCount; r=dbaron
Two comments in AnimationCommon.h refer to 'mFlushCount' which was presumably
the old name for mAnimationGeneration. Also, one comment says
nsCSSFrameConstructor tracks this. This patch adjusts the comments to refer
to mAnimationGeneration and RestyleManager.

(The reference to nsTransitionManager::UpdateAllThrottleStyles() is still valid
since there is useful documentation accompanying that method despite the fact
that the relevant code is mostly contained in AnimationCommon.h since bug
914847. Eventually we will unify the structures of transitions and
animations to the the point that we can replace the
IMPL_UPDATE_ALL_THROTTLED_STYLES_INTERNAL macro in AnimationCommon.h with an
actual method. At that point we can move the documentation accompanying
nsTransitionManager::UpdateAllThrottleStyles and its references to
AnimationCommon.)
2014-04-03 14:57:28 +09:00
Brian Birtles 016517a8be Bug 880596 part 8 - Rename ElementAnimation to StyleAnimation; r=dbaron
We need a basic representation of animations from which we can derive subclasses
to represent specific cases such as transitions. For now we will retrofit
ElementAnimation for that purpose hence renaming it to StyleAnimation.

This patch removes the "using namespace mozilla::layers" line from
AnimationCommon.cpp since the unified build system concatenates several files
together before compiling making using declarations like this leak into other
files potentially creating ambiguities. Previously, when we were calling
ElementAnimation, 'Animation', there were ambiguities between
mozilla::layers::Animation and this new 'Animation' class. In general, it is
probably a good idea to limit the scope of these using declarations so I've kept
that change.
2014-04-03 14:57:28 +09:00
Brian Birtles 70cf5d9db3 Bug 880596 part 7 - Move ElementAnimation to AnimationCommon; r=dbaron
This patch relocates ElementAnimation from nsAnimationManager.{h,cpp} to
AnimationCommon.{h,cpp} and in the process moves it into the mozilla::css
namespace.
2014-04-03 14:57:28 +09:00
Nicholas Cameron 9aa2bb4046 Bug 914847. Mini-flush for animations. r=dbaron 2013-10-22 14:14:41 +02:00
Cameron McCormack 5bbc325e7f Bug 922669 - Part 7: Add nsStyleSet::HasStateDependentStyle and nsCSSRuleProcessor:HasStateDependentStyle overrides that work on pseudo-elements. r=bz 2013-11-28 17:46:39 +11:00
Wes Kocher ce222963ef Backed out changeset 87ee0a1865e4 (bug 914847) 2013-10-22 16:55:14 -04:00
Nicholas Cameron 018dd19575 Bug 914847. Mini-flush for animations. r=dbaron 2013-10-22 14:14:41 +02:00
Markus Stange 4822f99e19 Bug 929362 - When refusing compositor animation during BuildLayer, set a property on the frame that disables all async animations on it forever. r=roc
--HG--
extra : rebase_source : 98c9b690a4842c19314dd46f5e531601b77fe527
2013-10-22 12:30:45 +02:00
Nicholas Cameron ab2aeb90c3 Bug 878142; be more precise about removing the animation manager from the refresh driver. r=dbaron 2013-06-25 20:58:46 +12:00
Catalin Iacob 6f4758d23e Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00
David Zbarsky a113dee00c Bug 874770 - Always enable OMTA throttling r=nrc 2013-05-22 18:31:03 +08:00
Arnaud Sourioux 623d2ed378 Bug 870516: Annotate ~600 more methods with MOZ_OVERRIDE in /layout r=dholbert 2013-05-14 09:33:23 -07:00
Joshua Cranmer 5765d5aec4 Bug 767563 - Add a clang static checker, part 3: Move the MOZ_MUST_OVERRIDE macro to MFBT. r=Waldo 2013-03-23 21:14:43 -05:00
Nicholas Cameron 136969e6e1 Bug 845188; initialise CommonAnimationData::mGenerationCount; r=roc 2013-02-26 19:21:26 +13:00
Nicholas Cameron c54f8d4754 Bug 780692; throttle OMTA (rollup patch). r=dbaron,bz
--HG--
extra : rebase_source : 1207275df5c509ac1974e2b9333c738b995f9d5e
2012-12-12 10:12:43 +13:00
Arnaud Sourioux a84a1b22ad Bug 733186: Annotate ~1000 methods with MOZ_OVERRIDE in /layout r=dholbert r=dbaron 2012-09-14 09:10:08 -07:00
David Zbarsky 18258768e4 Bug 785648 - Improve OMTA logging r=cjones 2012-08-25 21:27:28 -04:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -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 PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
David Zbarsky e37c2138c1 Move mStyleRule and mStyleRuleRefreshTime from ElementAnimations/ElementTransitions to CommonElementAnimationData, no bug, r=dbaron over irc 2012-08-21 21:48:47 -04:00
David Zbarsky 05b13cba8d Bug 784239 - Perform async animations even when not all properties can be asyncified r=roc 2012-08-21 21:48:47 -04:00
David Zbarsky bf4f8d3c97 Bug 755084 Part 2: Perform CSS animations of transform and opacity on the compositor r=roc, dbaron 2012-07-31 10:28:21 -07:00
Mark Finkle ecceaf8977 Backout 169ff207ed19, a34baed70c1b, f9ccdd490bd7, 39550ed860e6, 2194a2dd66b2, 908eb2e26843, a76e0a267f26 due to mobile viewport bustage (bug 778580) 2012-07-30 14:36:12 -04:00
David Zbarsky 93b20c52d3 Bug 755084 Part 2: Perform CSS animations of transform and opacity on the compositor r=roc, dbaron 2012-07-27 13:23:44 -07:00
Ed Morley 3ed23376d4 Backout 1244b8a8e57a (bug 755084), 32d16d0f87c9 (bug 706179), 8548e016d4a9 (bug 768440), 697f5b87eae9 (bug 768440), 808fc2bd4e8c (bug 755084), 54b1484cd125 (bug 755084), 876726b632c0 (bug 706179) for xul android R3 failures 2012-07-25 16:37:04 +01:00
David Zbarsky 630069520d Bug 755084 Part 2: Perform CSS animations of transform and opacity on the compositor r=roc, dbaron 2012-07-25 01:48:09 -07:00
Matt Brubeck 90029e0bf6 Back out f4f5189b1d0c, 3b4f0606c547, b8a5a1ab8a5f, 5078933d6954, 7e0260c45de9 (bug 768440, bug 755084, bug 706179) because of reftest failures 2012-07-23 20:25:51 -07:00
David Zbarsky ffaa635014 Bug 755084 Part 2: Perform CSS animations of transform and opacity on the compositor r=roc, dbaron 2012-07-23 17:34:46 -07:00
Ehsan Akhgari 2050b687cc Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (content parts); r=bzbarsky
--HG--
extra : rebase_source : e25a064995914ca4f7b1db16b5725eb440d3e531
2012-06-18 22:30:09 -04:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Nicholas Nethercote 8ea852b335 Bug 705987 - Use mallocSizeOf in the layout memory reporters. r=khuey,bzbarsky 2011-12-08 21:01:52 -08:00