Commit Graph

9 Commits

Author SHA1 Message Date
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
119a18fee3 Bug 1245748 - Remove no-longer-needed code for directly setting up properties in KeyframeEffect(ReadOnly) constructor; r=heycam
MozReview-Commit-ID: 4V3LMByas9Q

--HG--
extra : rebase_source : c2c687cd39b8287e7e9cb2a4edd12c86a056a0de
2016-03-22 16:36:45 +09:00
Brian Birtles
1cf303b56f Bug 1245748 - Add ApplyDistributeSpacing for Keyframe objects; r=heycam
MozReview-Commit-ID: 8KNERsl8tea

--HG--
extra : rebase_source : e48ca76aea6e93722f285bf59a8696d6a102bf99
2016-03-22 16:35:53 +09:00
Brian Birtles
93bd57b41f Bug 1245748 - Add GetAnimationPropertiesFromKeyframes; r=heycam
MozReview-Commit-ID: GUnogloqViS

--HG--
extra : rebase_source : ba999c9f9bf18683b7942dfefe0c0242124af474
2016-03-22 16:34:14 +09:00
Brian Birtles
56612fa76d Bug 1245748 - Add PropertyPriorityIterator; r=heycam
MozReview-Commit-ID: JjBWcyEG3f6

--HG--
extra : rebase_source : f3f4de1b665078112205883cb1885931b84ff6ee
2016-03-22 16:33:16 +09:00
Brian Birtles
7e9749fed0 Bug 1245748 - Split PropertyPriorityComparator into a separate (reusable) class; r=heycam
MozReview-Commit-ID: Gq5VylZoS2q

--HG--
extra : rebase_source : c47b937ef63df3dbabfe4dded9de42372c5403f6
2016-03-22 16:33:11 +09:00
Brian Birtles
b411ad9926 Bug 1245748 - Add nsStyleContext parameter to StyleAnimationValue::ComputeValue(s); r=heycam
StyleAnimationValue::ComputeValue(s) will automatically look up the style
context of the supplied element. This is mostly fine, but when we start using
this method in scenarios where we are building the initial style context
(as happens later in this patch series) it can easily land us in a situation
where we iterate indefinitely.

It would be better, instead, to just explicitly pass in the style context we
want to use, as we already do for StyleAnimationValue::ExtractComputedValue.

MozReview-Commit-ID: ZoVBlBRRBI

--HG--
extra : rebase_source : 9012cc2e405fc887f070fbfaa2f9853289882862
2016-03-22 16:31:09 +09:00
Brian Birtles
67707b72eb Bug 1245748 - Add KeyframeUtils::GetKeyframesFromObject; r=heycam
MozReview-Commit-ID: 2cl8NIMApSy

--HG--
extra : rebase_source : f0cafad483afcf36efa86f6fa137bbffd068bcb5
2016-03-22 16:25:38 +09:00
Brian Birtles
9ccb67c08b Bug 1245748 - Move keyframe handling code to a separate KeyframeUtils class; r=heycam
MozReview-Commit-ID: 2r27vCLcOhs

--HG--
extra : rebase_source : 6ba24ece944543e250728cf2b18370c277e746d0
2016-03-22 16:20:37 +09:00