Commit Graph

50 Commits

Author SHA1 Message Date
Manish Goregaokar
960f182e2f Bug 1317208 - Stylo: Store servo computed values for animation properties; r=birtles,heycam
MozReview-Commit-ID: IoQLN5tdIBw

--HG--
extra : rebase_source : da6a19192b639feaef828d2849fc8e4f8085c0f4
2016-11-30 17:34:54 -08:00
Hiroyuki Ikezoe
5201cc33f3 Bug 1311620 - Part 4: Implement keyframe composite(add). r=birtles
This patch also fixes expected computed offset values in frame at 0.5 offset for
add composite.

MozReview-Commit-ID: 8PNp237NoV4

--HG--
extra : rebase_source : 7bdf83741198fb81c6721cad1764e6464033c240
2016-12-24 19:54:27 +09:00
Michael Layzell
c6fccac579 Bug 1299489 - Change nsTArray to use a custom iterator based on index instead of pointers to improve iterator invalidation safety of ranged for loops, r=froydnj
MozReview-Commit-ID: CahPOcRYvES
2016-12-08 15:54:45 -10:00
Hiroyuki Ikezoe
869c4ead65 Bug 1291468 - Part 2: Implement keyframe composite(accumulate). r=birtles
Test cases in file_composite.html are matching pair of tests in
web-platform-tests.

MozReview-Commit-ID: ApuvVCHKQ8Y

--HG--
extra : rebase_source : 58342389a3eb1ed2a3c1889b5ce974dbde19c32f
2016-12-04 08:07:41 +09:00
Hiroyuki Ikezoe
1f8b99b847 Bug 1305325 - Part 6: Handle missing keyframe whose offset 0 or 1 on the main thread. r=birtles
MozReview-Commit-ID: 5WMiTJQKfZd

--HG--
rename : dom/animation/test/chrome/test_animation_properties.html => dom/animation/test/chrome/test_simulate_compute_values_failure.html
2016-12-04 08:07:40 +09:00
Nathan Froyd
c8d4517ee9 Bug 1315004 - rename Range::start to Range::begin to match C++ conventions; r=botond
Among other things, this change means that you can use ranged-for syntax
with Range, which is more fitting and pleasant than the alternative.
2016-11-05 21:13:38 -04:00
Boris Chiou
304026cd9d Bug 1272549 - Part 9: Compute distance for mismatched transform lists. r=birtles
MozReview-Commit-ID: JJWcMgj88GX

--HG--
extra : rebase_source : 3f1c314a2bf9c7c12991fb3873738c79b0152ea9
2016-10-05 15:36:16 +08:00
Xidorn Quan
a899c1a9ac Bug 1312338 part 2 - Use nsACString to pass string parameters in binding functions. r=manishearth
MozReview-Commit-ID: BRKZBQJCrMQ

--HG--
extra : source : c0a7498ea402f1db4aca1c05508f577bacf21f0c
2016-10-25 10:19:45 +11:00
Xidorn Quan
131121fc77 Bug 1311598 part 3 - Add include ServoBindings.h to files need it. r=heycam
MozReview-Commit-ID: 3fI0bt4p8Jd

--HG--
extra : rebase_source : 86fa88f15183d1503c92044afca3e86649ec2523
extra : source : 5acc7cffb73234e2664c31f8283fa8a50f0be1b5
2016-10-24 20:16:46 +11:00
Xidorn Quan
00100a750f Bug 1309109 part 3 - Rename ServoDeclarationBlock to RawServoDeclarationBlock. r=heycam
So that the new subclass of DeclarationBlock could just be
ServoDeclarationBlock.

MozReview-Commit-ID: 55KgfmWmmyU

--HG--
extra : source : 27c55355da341fce112b15d966eb9b2fa2c8834b
2016-10-18 15:29:03 +11:00
Brian Birtles
33c4f00dda Bug 1302949 - Compute StyleAnimationValue objects from servo declaration blocks; r=heycam
MozReview-Commit-ID: 6Am1FRC9uV0

--HG--
extra : rebase_source : 570ed28437ecaa22ac7571a9b47388e8abd0cb96
extra : histedit_source : 04443b7b7d89296b8498a5e657b1e7eeb3105dc8
2016-09-16 11:08:44 +09:00
Brian Birtles
620aaf6580 Bug 1302949 - Parse animation values with Servo backend; r=heycam
MozReview-Commit-ID: 4UW1fIIjvdi

--HG--
extra : rebase_source : edeaec568446897c5005640d63390ec5bf3751d2
extra : histedit_source : e7498ae2f573a3766fbf7686f1c6cdcc64ca3280
2016-09-16 10:24:05 +09:00
Brian Birtles
4f94caf471 Bug 1302949 - Skip invalid animation values; r=heycam
For animation values parsed using the Servo backend that are invalid,
we simply end up with an empty declaration block (and we fill in |mValue|
with the string so we can later serialize it).

MozReview-Commit-ID: 6ruwJGVzRla

--HG--
extra : rebase_source : 83e415febf10cf90631fd7a1b447921822a44bc0
2016-09-16 09:58:35 +09: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
Brian Birtles
732a6955f2 Bug 1300045 part 1 - Tidy up some missing includes r=hiro
I came across these while working on a different bug that changed the grouping
in the unified build. Adding these as a separate step will hopefully remove a
little noise from the next patch in the series.

MozReview-Commit-ID: Km7wTcVWG9n

--HG--
extra : rebase_source : 0610add67482c1a5aa7c4f576e151ed9437698c0
2016-09-04 16:33:38 +09:00
Nicholas Nethercote
fb96bf1f91 Bug 1298722 - Use MOZ_MUST_USE in StyleAnimationValue. r=birtles.
--HG--
extra : rebase_source : c5b8cca624b9ffa7b3263b1aa7ce4f64dd80f13b
2016-08-30 16:10:59 +10:00
shundroid
681ce6a486 Bug 1289928 - Drop nsStyleContext* argument from BuildSegmentsFromValueEntries r=hiro
MozReview-Commit-ID: KxyTVGaePjT

--HG--
extra : rebase_source : 23ba662f141c6e5b3fdeeaab1745eae49e4dea3a
2016-08-27 12:41:02 +09:00
Boris Chiou
3564271f97 Bug 1290535 - Part 1: Sort paced subproperties before calculation. r=hiro
MozReview-Commit-ID: 9sEghbxLlzO

--HG--
extra : rebase_source : 25d738af1bf76f424d83af1ee988cf07c43c41f8
2016-08-19 12:21:22 +08:00
Jonathan Chan
b35975ec17 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.

(NOTE: Re-landing this patch on a CLOSED TREE to correctly-address the merge bustage that closed the tree.)

MozReview-Commit-ID: ASUNs7FWbKP

--HG--
rename : layout/style/nsCSSPropertySet.h => layout/style/nsCSSPropertyIDSet.h
2016-08-16 18:46:58 -07:00
Jonathan Chan
4b87f11bd9 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-16 18:37:48 -07:00
Gregory Szorc
1794619188 Backed out changesets dcdb85fc5517, 702bca0deee2, 9cKX8gC1ATA (bug 1293739) for build bustage; a=bustage
The merge from inbound to central conflicted with the merge from
autoland to central, it appears. Per tree rules, the commit from the
autoland repo wins and the inbound commit gets backed out.

CLOSED TREE

--HG--
extra : amend_source : 927e1cdfa8e55ccbd873d404d905caf6871c8c4f
extra : histedit_source : 07095868c3f767258e1d7d2645193bf4811b13bb%2Ca49ae5a28bf6e67298b6208ee9254c25a2539712
2016-08-16 17:50:40 -07: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
Cameron McCormack
4a1bd90eff Comment grammar fix; no bug (DONTBUILD). r=sbaratheon
MozReview-Commit-ID: 2pNBAS1oeSN
2016-08-09 15:10:57 +08: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
7d054e7e89 Bug 1277456 part 5 - Pass the document associated with an AnimationEffectTiming/KeyframeEffect object to KeyframeUtils as the context to use when parsing CSS properties; r=hiro
Note that when we actually compute values, we will use the composed document of
the target element (see the next patch in this series).

MozReview-Commit-ID: 8Pp3y19pltP

--HG--
extra : rebase_source : bb1c21f3fdcf2e831213d2f278d70e4ca2637028
2016-07-13 13:22:25 +09:00
Boris Chiou
c16e36114d Bug 1286196 - Use the new constructor of Range<T> in KeyframeUtils. r=birtles
MozReview-Commit-ID: SRJFZfu7ps

--HG--
extra : rebase_source : 45c30649b575b313a3e1b3de87b483deccb4bcdf
2016-07-13 11:00:43 +08:00
Boris Chiou
34e916b2cb Bug 1244590 - Part 7: Calculate paced spacing. r=birtles
Calculate the paced spacing for each Keyframes by the context element. Use the
algorithm in the spec.

MozReview-Commit-ID: HFWQwoKhKWt

--HG--
extra : rebase_source : 40112eb1f722179cfc0a4ccbd188e22bc7af9b9b
2016-05-27 18:09:06 +08:00
Boris Chiou
95267f5a26 Bug 1244590 - Part 6: Refactor the calculation of StyleAnimationValue. r=birtles
We want to reuse the StyleAnimationValues of properties of each keyframe when
applying spacing and building animation property segments, so refactor this
part.

MozReview-Commit-ID: 8G56C3BU3FR

--HG--
extra : rebase_source : 73b6d374ac8bd25645d1b1b2f15f4e778b3ec949
2016-05-25 17:10:53 +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
8c0079ef08 Bug 1244590 - Part 4: Rewrite ApplyDistributeSpacing. r=birtles
Rename it to ApplySpacing, and let it handle both distribute and paced mode.

MozReview-Commit-ID: 2kGA6LMHUsz

--HG--
extra : rebase_source : ebd5566392b1ea6a4a445ff7c3ed81cdc94bdded
2016-05-10 17:40:53 +08:00
Boris Chiou
03d90dd78b Bug 1244590 - Part 3: Parse spacing. r=birtles
We only support spacing mode from Web Animations API, so add a simple parser and
use it only from the API. In this patch, parse spacing mode from the constructor
and throw TypeError if we have any parse error.

MozReview-Commit-ID: 9H7g80IcZfZ

--HG--
extra : rebase_source : e1bc781ff0f20a1a38c04e672832ec013edc549d
2016-05-13 16:38:25 +08:00
Brian Birtles
7dbb4e5cf3 Bug 1276688 part 2 - Add tests for entries array handling when ComputeValues fails; r=heycam, r=smaug
MozReview-Commit-ID: DIQyt7f91an
2016-06-28 16:10:10 +09:00
Brian Birtles
5aaca3d44e Bug 1276688 part 1 - Handle entries arrays where we don't have a property value at the 0.0/1.0 offset; r=heycam
MozReview-Commit-ID: GCCF4taOC6z

--HG--
extra : rebase_source : b2238ce7aa1fde865810ca70774d51cd1f5b7c8b
2016-06-09 08:12:52 +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
Brian Birtles
b7858fac74 Bug 1264822 part 4 - Ignore shorthand properties when all their subproperties are not-animatable; r=hiro
This patch also includes a tweak to not-animatable.html to match the order in
which properties are enumerated on the object. This test was always in error but
we never noticed since the test failed before reaching the test in question.

Making the test dependent on the order in which object properties is enumerated
is not good but we will remove this test in the next patch. In this patch we
just make sure it passes.

MozReview-Commit-ID: AKXdHj4nUMv

--HG--
extra : rebase_source : 64270ae9d9cf68cdf534baaf198583fb1974025c
2016-05-17 14:09:11 +09:00
Brian Birtles
4dafc82388 Bug 1268858 part 2 - Distinguish between valid and invalid token stream values in keyframe value handling; r=heycam
In order to support CSS variable references in animation properties we need to
handle token stream values. However, we already use token stream values for two
other purposes:

* To store shorthand property values
* To store invalid longhand property values

The shorthand property value case is already handled correctly, however for
longhand values we need to distinguish between valid token streams (e.g.
values that contain variable references) and invalid values stored as token
streams.

This patch makes us do that by looking at the mPropertyID member of the
nsCSSValueTokenStream object which will be eCSSProperty_UNKNOWN for an invalid
value but will be set to something sensible for a valid token stream.


MozReview-Commit-ID: AXUaO5dopBC
2016-05-13 11:56:10 +09:00
Xidorn Quan
fa7ba2cb82 Bug 1269975 part 1 - Move nsCSSProps::EnabledState to a top level enum class mozilla::CSSEnabledState. r=heycam
MozReview-Commit-ID: 3KH5cqDFzUI

--HG--
extra : rebase_source : 3c8355f7807982152a16a913b31cbcdd6ef78030
extra : source : 73e89d25a34ca5587f306b848b0b801342f9432f
2016-05-10 18:44:05 +10:00
Ryan VanderMeulen
f514ed495c Backed out 4 changesets (bug 1269975) for bustage.
Backed out changeset a55ecedea260 (bug 1269975)
Backed out changeset 5321545b938c (bug 1269975)
Backed out changeset 7e4a2ee61ef3 (bug 1269975)
Backed out changeset d181f8e7e4c3 (bug 1269975)
2016-05-10 00:08:54 -04:00
Xidorn Quan
30a6d76b26 Bug 1269975 part 1 - Move nsCSSProps::EnabledState to a top level enum class mozilla::CSSEnabledState. r=heycam
MozReview-Commit-ID: 3KH5cqDFzUI

--HG--
extra : source : 73e89d25a34ca5587f306b848b0b801342f9432f
2016-05-10 13:36:25 +10:00
Mantaroh Yoshinaga
1a3a4d293d Bug 1259285 - Part1 - Move CSS/Web Animations-specific visibility handling. r=birtles
MozReview-Commit-ID: 5ZYUhvI1cqV

--HG--
extra : transplant_source : %85%01%5C%91%EB%C2%F9%F5a%82%5C%FCZKz%F7%2B%27%F7%9C
2016-04-20 09:05:29 +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
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