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

144 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou f8dbd6bb32 Bug 1339690 - Part 3: Drop spacing mode. r=birtles,smaug
MozReview-Commit-ID: 1c7jpzWQjVP

--HG--
extra : rebase_source : 7850e290abb5fd87684c99710666c881eb777eb4
2017-06-13 15:09:19 +08:00
Brian Birtles 33041d1214 Bug 1315874 - Drop 'ForElement' from GetStyleContextForElementXXX methods; r=heycam
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.

MozReview-Commit-ID: JQKaEuCKV2F

--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef
2017-04-05 14:39:23 +09:00
Hiroyuki Ikezoe 92a8f642ee Bug 1216844 - Implement KeyframeEffect::SetComposite(). r=boris,smaug
MozReview-Commit-ID: C9wHsriHgZ9

--HG--
extra : rebase_source : 85ddcf39ed54dd5add692421c10f3bfb6e9d3ceb
2016-12-14 08:51:44 +09:00
Boris Zbarsky 59f74104a6 Bug 1321879 part 2. Stop using IsCallerChrome() in animations API. r=birtles 2016-12-06 23:47:23 -10:00
Boris Chiou ab45c606ea Bug 1273784 - Part 1: Add the copy constructor of KeyframeEffect(ReadOnly) in webidl. r=smaug
MozReview-Commit-ID: Fkddf8axUrU

--HG--
extra : rebase_source : 85e78c8a7fcebfbd5feb75950d5da34c2c05d255
2016-10-28 15:41:08 +08:00
Hiroyuki Ikezoe f98523cf02 Bug 1216843 - Part 2: Implement effect iteration composition. r=birtles, r=smaug
MozReview-Commit-ID: 6u7WtXwL3y3
2016-09-13 11:48:44 +09:00
Boris Chiou adeea43b3b Bug 1274944 - Part 1: Add writable spacing attribute. r=smaug
Use [SetterThrows] for KeyframeEffect.spacing because it throws if the input
string is not conformed to the grammar.

MozReview-Commit-ID: CkAnPu8TnV

--HG--
extra : rebase_source : af0960391684323a25ac0b40da28dcbe5c3c2919
2016-08-31 16:58:57 +08:00
Brian Birtles 48f29038db Bug 1300045 part 2 - Split KeyframeEffect.cpp into KeyframeEffect{ReadOnly}.cpp r=hiro,smaug
MozReview-Commit-ID: DdBEicunApv

--HG--
rename : dom/animation/KeyframeEffect.cpp => dom/animation/KeyframeEffectReadOnly.cpp
rename : dom/animation/KeyframeEffect.h => dom/animation/KeyframeEffectReadOnly.h
extra : rebase_source : 70063d8ba09c9c457f22771e9b514ddc9fee1612
2016-09-04 16:34:21 +09:00
Boris Chiou 8bb94c4499 Bug 1298742 - Part 1: Factor out MarkCascadeUpdate(). r=hiro
We mark the cascade update many times, so it's better to factor it out.

MozReview-Commit-ID: HbE980gOJ9M

--HG--
extra : rebase_source : a76dfc489f378c5bd7e711f296d0599ecf2322c5
2016-08-29 18:46:07 +08:00
Hiroyuki Ikezoe e1bd66d4f8 Bug 1298755 - Part 2: Drop ResetWinsInCascade in KeyframeEffect::SetTarget() since it has no effect. r=birtles
The purpose of ResetWinsInCascade() in SetTarget() ensures that
RequestRestyle(Layer) is invoked for the new target in the case when
composite order or CSS cascading or order is changed due to chaging target
element, but RequestRestyle(Layer) will be called right after setting
the new target in SetTarget() explicitly.

MozReview-Commit-ID: 1cFJCAEEroP

--HG--
extra : rebase_source : c3008ef15d0328466f77015020c5148ef2ad07c6
2016-08-31 13:58:05 +09:00
Boris Chiou 7b026ef179 Bug 1049975 - Part 9: Implement writable Animation effect. r=birtles
MozReview-Commit-ID: 1dwHpcYJto3

--HG--
extra : rebase_source : 0dba49f8e12c5ed9d3214744a186b8fe6923f48e
2016-07-13 18:44:19 +08:00
Boris Chiou 302c927139 Bug 1049975 - Part 5: Move timing related code into AnimationEffectReadOnly. r=birtles
Move the mTiming, mAnimation, and the implementaion of timing into
AnimationEffectReadOnly.

MozReview-Commit-ID: EZhlbphVvCo

--HG--
extra : rebase_source : 4aa4821304671a8dfc6feb047ab20b26ef2d6b11
2016-07-25 18:27:33 +08:00
Boris Chiou 623caf07af Bug 1049975 - Part 4: Merge two Animation::SetEffect()s. r=birtles
This is a pre-patch for part 5, which is trying to make our code closer to the
spec. Some methods in KeyframeEffectReadOnly belong to AnimationEffectReadOnly,
so first, use AsKeyframeEffect() to access those keyframe-related methods, and
then add virtual methods for timing-related methods to AnimationEffectReadOnly.

MozReview-Commit-ID: 1srA1f8JYeN

--HG--
extra : rebase_source : 99a06e20a63b9c8b179fa8501690abf01271aaf4
2016-07-25 16:56:34 +08:00
Brian Birtles 4bf632c00c Bug 1286476 part 2 - Respect the playback rate when calculating phase boundaries; r=hiro
This implements the spec change in 21de090dac

The spec change refers to a binary 'animation direction' flag. Instead of that,
however, we just pass the playback rate along and use it inside
GetComputedTimingAt since this seems simpler.

Also, this patch moves the implementation of
KeyframeEffectReadOnly::GetComputedTiming from the header file into the .cpp
file. This is because with this change, GetComputedTiming needs to call
mAnimation->PlaybackRate() and so mozilla::dom::Animation needs to be a complete
type. However, simply including Animation.h doesn't work because of a cyclic
dependency between KeyframeEffect.h and Animation.h. We might be able to fix
this later but since yet-to-land bug 1049975 moves this code around a lot, I'd
rather not touch it too much just now.

MozReview-Commit-ID: 1h6XRh4xmfI
2016-08-17 08:28:41 +09:00
Wes Kocher b7ea1393f2 Backed out 3 changesets (bug 1286476) for frequent windows wpt failures in phases-and-states.html CLOSED TREE
Backed out changeset 53bbfa02d45d (bug 1286476)
Backed out changeset 3947ab570883 (bug 1286476)
Backed out changeset ffd8c37eb695 (bug 1286476)
2016-08-17 10:41:46 -07:00
Brian Birtles eac25e3163 Bug 1286476 part 2 - Respect the playback rate when calculating phase boundaries; r=hiro
This implements the spec change in 21de090dac

The spec change refers to a binary 'animation direction' flag. Instead of that,
however, we just pass the playback rate along and use it inside
GetComputedTimingAt since this seems simpler.

Also, this patch moves the implementation of
KeyframeEffectReadOnly::GetComputedTiming from the header file into the .cpp
file. This is because with this change, GetComputedTiming needs to call
mAnimation->PlaybackRate() and so mozilla::dom::Animation needs to be a complete
type. However, simply including Animation.h doesn't work because of a cyclic
dependency between KeyframeEffect.h and Animation.h. We might be able to fix
this later but since yet-to-land bug 1049975 moves this code around a lot, I'd
rather not touch it too much just now.

MozReview-Commit-ID: 1h6XRh4xmfI
2016-08-17 08:28:41 +09:00
Jonathan Chan 4ffd49c097 Bug 1293739 - Part 2: Rename nsCSSPropertySet to nsCSSPropertyIDSet. r=dholbert
The previous patch in this series renamed nsCSSProperty to nsCSSPropertyID.
This patch renames nsCSSPropertySet to nsCSSPropertyIDSet accordingly.

This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSPropertySet\b/nsCSSPropertyIDSet/g' -i''

Then:

  hg mv layout/style/nsCSSPropertySet.h layout/style/nsCSSPropertyIDSet.h

... and finally, manually renaming nsCSSPropertySet in the include guard in
nsCSSPropertyIDSet.h.

MozReview-Commit-ID: ASUNs7FWbKP

--HG--
rename : layout/style/nsCSSPropertySet.h => layout/style/nsCSSPropertyIDSet.h
2016-08-09 16:28:21 -07:00
Jonathan Chan 9c62a2c11c Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''

Then:

  hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h

... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.

MozReview-Commit-ID: ZV6jyvmLfA

--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
2016-08-09 16:28:19 -07:00
Hiroyuki Ikezoe 9c3e690c9a Bug 1287725 - Drop KeyframeEffectReadOnly::HasAnimationOfProperties and nsLayoutUtils::HasCurrentAnimationsForProperties. r=birtles
MozReview-Commit-ID: K33ga7KpLIo

--HG--
extra : rebase_source : 57bc8f2edffb7e89ea790f5cc0fa6848770d1873
2016-07-26 06:44:11 +09:00
Hiroyuki Ikezoe f8455c2c9a Bug 1288586 - Don't calculate style difference if there are no properties change. r=birtles
We don't actually need to re-calculate if the updated properties are the
same as the old one. This change avoids problematic nested calls of
nsStyleSet::GetContext() in particular cases.

MozReview-Commit-ID: JksiTGX57Fy
2016-07-22 15:17:37 +09:00
Brian Birtles b3d639f650 Bug 1277456 part 6 - Use the composed document of the target effect (if any) when computing keyframe values; r=hiro
Previously, when fetching an nsPresShell, we would look up the current realm
document and get the pres shell for it. This patch makes us call GetPresShell()
which uses GetRenderedDocument() which corresponds to the composed document of
the target effect which seems more consistent since it is the target effect we
will use as context for computing CSS values (as required by [1]).

[1] https://w3c.github.io/web-animations/#calculating-computed-keyframes

MozReview-Commit-ID: 9S55041rfTp

--HG--
extra : rebase_source : c52d4c366d0a2891958c8f7378614a8feb5e7c70
2016-07-13 13:22:25 +09:00
Hiroyuki Ikezoe d20c596b42 Bug 1279403 - Part 2: Set NS_FRAME_MAY_BE_TRANSFORMED bit if the target nsIFrame has transform when setting target or keyframes. r=birtles
MozReview-Commit-ID: InQyXpENsSY

--HG--
extra : rebase_source : f8eb4c9ea0495d60c92a214ab692df79cf428e85
2016-07-11 08:29:14 +09:00
Chris Peterson 43c2748f66 Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Brian Birtles 3743434413 Backed out changeset f182a6c18d75 (bug 1279819) 2016-07-06 09:09:55 +09:00
Brian Birtles 454f9549c2 Bug 1279819 - Copy keyframes array before iterating over it; r=hiro
MozReview-Commit-ID: KMacnQcFx9f
2016-07-06 08:00:44 +09:00
Boris Chiou 0a3a365c73 Bug 1244590 - Part 8: Rewrite GetStyleContext code. r=birtles
Do a simple refactor, so we can reuse the getter of nsStyleContext.

MozReview-Commit-ID: 4BQ7f8HuFns

--HG--
extra : rebase_source : 37bbf6af795484c5d80d308683e4fcdfe23c7a1a
2016-05-11 11:41:20 +08:00
Boris Chiou 10a18165f4 Bug 1244590 - Part 5: Make the default value of computed offsets be -1. r=birtles
When we apply paced spacing, we have to check if there are still null computed
offsets after applying paced spacing to paceable Keyframes because the
calculation of distance may be failed or some Keyframes are not paceable in
the specific range. Therefore, using -1 would be easier to check it.
Also, add a const, kComputedOffsetNotSet, to represent this invalid value.

MozReview-Commit-ID: GPhj7cdiX2W

--HG--
extra : rebase_source : 8c4e7769c454fe50eb1cc08db63866dcc4ed62e5
2016-05-12 16:00:47 +08:00
Boris Chiou c55ea50fab Bug 1244590 - Part 1: Introduce KeyframeEffectParams. r=birtles
Add a new file, KeyframeEffectParams.h, and define the basic data
members nsString for the spacing mode.
Also, add one more argument, const KeyframeEffectParams&, to the
constructors of KeyframeEffect(ReadOnly).

MozReview-Commit-ID: I7LYlnv6LLb

--HG--
extra : rebase_source : 9aebb7b9659588674c2a954eb2ce62c827bc9830
2016-05-05 15:41:03 +08:00
Jonathan Watt b15368cfcb Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Hiroyuki Ikezoe b2888c83cd Bug 1166500 - Part 7: Throttle paint-only animations if the presShell is not active. r=dbaron 2016-05-24 12:57:43 +09:00
Hiroyuki Ikezoe eec4931934 Bug 1166500 - Part 3: Add KeyframeEffectReadOnly::CanIgnoreIfNotVisible(). r=dbaron 2016-05-24 12:57:42 +09:00
Hiroyuki Ikezoe caa5bb7b54 Bug 1166500 - Part 2: Calculate cumulative change hint. r=dbaron
In order to raise an assertion in CanIgnoreIfNotVisible() which will be
introduced in part 3 when the cumulative hint is not properly, we should skip
the calculation when mProperties is empty.
2016-05-24 12:57:42 +09:00
Hiroyuki Ikezoe ad26dd6ea3 Bug 1166500 - Part 1: Store change hints between from and to for each animation segment. r=dbaron
BuildSegmentsFromValueEntries now needs base nsStyleContext to calculate
the change hints.
If the change hint is not set correctly, we will check it in
CanIgnoreIfNotVisible() introduced in a subsequent patch (part 3).
2016-05-24 12:57:42 +09:00
Hiroyuki Ikezoe 00e2f46aeb Bug 1268385 - Clear isRunningOnCompositor for script animations if associated nsIFrame is destroyed. r=birtles
MozReview-Commit-ID: 3tTkDtxkHcT

--HG--
extra : rebase_source : 388f548cb30f5384cceb620a595dd10b5fd22e4e
2016-05-16 16:25:46 +09:00
Brian Birtles 90fb66a530 Bug 1271904 - Rename KeyframeEffectReadOnly.getFrames() and KeyframeEffect.setFrames() to getKeyframes()/setKeyframes(); r=hiro, r=smaug
MozReview-Commit-ID: GwLLY39l1KE

--HG--
rename : dom/animation/test/css-animations/file_keyframeeffect-getframes.html => dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-animations/test_keyframeeffect-getframes.html => dom/animation/test/css-animations/test_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-transitions/file_keyframeeffect-getframes.html => dom/animation/test/css-transitions/file_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-transitions/test_keyframeeffect-getframes.html => dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes.html
rename : testing/web-platform/meta/web-animations/keyframe-effect/setFrames.html.ini => testing/web-platform/meta/web-animations/keyframe-effect/setKeyframes.html.ini
rename : testing/web-platform/tests/web-animations/keyframe-effect/setFrames.html => testing/web-platform/tests/web-animations/keyframe-effect/setKeyframes.html
2016-05-13 09:40:52 +09:00
Boris Chiou 44367b12f2 Bug 1067769 - Part 12: Use Maybe<OwningAnimationTarget> in KeyframeEffect(ReadOnly) constructors. r=birtles
MozReview-Commit-ID: Euv76D6sIFX

--HG--
extra : rebase_source : 7ef6e5d70104942b21671e2143c107e678f400a7
2016-04-28 23:22:44 +08:00
Boris Chiou 6b5b1483f8 Bug 1067769 - Part 10: Implement SetTarget(). r=birtles
MozReview-Commit-ID: GW3Ujn5cbY3

--HG--
extra : rebase_source : ffc006c67d5b0dd712c4d7d3f938c37b8167ad58
2016-04-28 23:22:43 +08:00
Boris Chiou cba7a5b73d Bug 1067769 - Part 9: Wrap RequestRestyle and UnregisterTarget. r=birtles
We will need to request a restyle and unregister the current target in
SetTarget(), and there are many duplicate code segments for them now, so wrap
them for reusing the code.

MozReview-Commit-ID: 33XoNspZme3

--HG--
extra : rebase_source : 881aa13d79ccc75872a6cc48d0a1da71cfdff2ae
2016-04-28 23:22:43 +08:00
Boris Chiou d423a8f2b2 Bug 1067769 - Part 7: Define OwningAnimationTarget and use it. r=birtles
1. Define OwningAnimationTarget.
2. Replace the KeyframeEffectReadOnly::mTarget/mPseudoType members with
   a Maybe<OwningAnimationTarget> mTarget member.

MozReview-Commit-ID: 65qOoNyDRSy

--HG--
extra : rebase_source : b938dbc00c918861d4141128fad8e30f61668e40
2016-04-28 23:22:43 +08:00
Boris Chiou 22e871661b Bug 1067769 - Part 6: Rename NonOwningAnimationTarget.h to AnimationTarget.h. r=birtles
MozReview-Commit-ID: ErAaPe6ttjc

--HG--
rename : dom/animation/NonOwningAnimationTarget.h => dom/animation/AnimationTarget.h
extra : rebase_source : 79b52ece67f16bd32ac8c07d698a9aae076fe5fe
2016-04-28 23:22:43 +08:00
Boris Chiou 57a8894260 Bug 1067769 - Part 5: Support setting KeyframeEffect.target webidl interface. r=smaug
MozReview-Commit-ID: 9494jdI97MT

--HG--
extra : rebase_source : 4c8fa7bfb6502c78a96e1af1e2a6d98d7708d7dd
2016-04-28 23:22:43 +08:00
Nathan Froyd 5672bb749c Bug 1259733 - use forward declarations for nsIDocument in a few places; r=dholbert
This is sufficient for nsCSSFrameConstructor.h's needs, and the
corresponding C++ file already includes nsIDocument.h.
2016-04-27 14:48:36 -04:00
Ryo Kato ed3e9e9db3 Bug 1244591 - Part 1: Implement KeyframeEffect.setFrames r=birtles,smaug
WebIDL referes to KeyframeEffect::SetFrames(), which is derived from
KeyframeEffectReadOnly::SetFrames() in terms of implementation.

In addition, make KeyframeEffectReadOnly::ConstructKeyframeEffect call
KeyframeEffectReadOnly::SetFrames() to simplify the code.

MozReview-Commit-ID: 7ASbtoN7Tnp

--HG--
extra : rebase_source : c398ff7154c4533255f56c7ca13314e440eb6258
2016-04-09 15:33:34 +09:00
Hiroyuki Ikezoe ffc5ef3515 Bug 1263063 - Part 4: Move ActiveDuration() into TimingParams. r=dholbert
MozReview-Commit-ID: 4HS8vTJYtDe

--HG--
extra : rebase_source : 5ccdc1aa1ffe0c33a0d334cf2a4736877481cd28
2016-04-14 19:39:39 +09:00
Boris Chiou 1decf4e780 Bug 1249564 - Part 2: Cycle collect AnimationEffectTimingReadOnly. r=birtles
Add KeyframeEffectReadOnly::mTiming into the list of cycle collection to
avoid any possible memory leak.

MozReview-Commit-ID: C5mFQ7TsqC7

--HG--
extra : rebase_source : 8ee1e58d69a3becb0b8566fa3529154bb66d3064
2016-04-13 18:20:46 +08:00
Brian Birtles 9552e36446 Bug 1260655 - Drop some no-longer-needed code for setting up CSS animations using AnimationProperty objects; r=heycam
MozReview-Commit-ID: JDzvQIxlsX6
2016-03-30 13:01:20 +09:00
Brian Birtles 871add346f Bug 1260655 - Add a copy constructor and copy assignment operator to Keyframe; r=heycam
It turns out that std::stable_sort on Mac and Android use this.

Bug 1263500 tracks doing something more efficient on those platforms.

MozReview-Commit-ID: 3tGbnoW67QP
2016-03-31 16:26:52 +09:00
Brian Birtles 56ab406ea8 Bug 1260655 - Add an assignment operator to Keyframe that takes an rvalue reference; r=heycam
This is needed in order to use std::stable_sort with this type since some
implementations of std::stable_sort require this (as opposed to simply a move
constructor).

MozReview-Commit-ID: 5QmcIxkC4aB
2016-03-29 11:29:20 +09:00
Brian Birtles bdacb97d48 Bug 1260655 - Add KeyframeEffectReadOnly::SetFrames; r=heycam
Earlier in this patch series we divided keyframe processing into two stages:

  (1) Turning javascript objects into an array of Keyframe objects
  (2) Calculating AnimationProperty arrays from the Keyframe objects

This patch creates a SetFrames method so that CSS animations and
CSS transitions can skip (1) and pass the frames constructed from CSS syntax
into (2).

It also adds the following additional processing:

a. Notifying animation mutation observers when the set of frames has changed.

   This is currently performed by nsAnimationManager but ultimately we should
   encapsulate this logic inside the effect itself. Furthermore, it will be
   needed when we implement effect.setFrames() (i.e. the Javascript-facing
   wrapper for this method).

b. Preserving the mWinsInCascade and mIsRunningOnCompositor state on properties
   when updating them.

   This is currently performed by:

      bool KeyframeEffectReadOnly::UpdateProperties(
          const InfallibleTArray<AnimationProperty>& aProperties)

   which is what nsAnimationManager currently uses. We will ultimately remove
   the above method and here we are just moving this code to the new version
   of UpdateProperties.

c. Requesting a restyle when the set of AnimationProperty objects has changed.

   Again, this is currently performed by the existing UpdateProperties method
   so we are just moving it here. This behavior will also be required when
   we implement effect.setFrames() and when we call UpdateProperties from
   elsewhere in restyling code.

   This is bug 1235002 but we fix it here and leave that bug to just do further
   cleanup work (e.g. re-instating the check for an empty property set before
   requesting a restyle in NotifyAnimationTimingUpdated).

d. Marking the cascade as needing an update when the set of AnimationProperty
   objects has changed.

   This is in preparation for calling UpdateProperties from elsewhere in
   restyling (e.g. when the nsStyleContext is updated).


MozReview-Commit-ID: 2ll26lsWZTm
2016-03-30 08:59:08 +09:00
Brian Birtles ded9534a6c Bug 1245748 - Add a Move constructor to Keyframe; r=heycam
I have confirmed that by adding this, we end up calling SwapElements() on the
mPropertyValues member when we build up the nsTArray<Keyframe> result in
GetKeyframeListFromPropertyIndexedKeyframe. Without this explicit move
constructor (i.e. with only the default move constructor) the copy-constructor
for mPropertyValues is called.

MozReview-Commit-ID: 6IWkP97RFUr

--HG--
extra : rebase_source : 4ac4b6545337810a3047f2cfb1dac86074116cfb
2016-03-24 10:39:29 +09:00