Commit Graph

1181 Commits

Author SHA1 Message Date
Boris Chiou
a583863fc8 Bug 1352067 - Part 1: Make sure AnimationValue::{mGecko|mServo} are mutually exclusive. r=birtles,emilio
We will obsolete StyleAnimationValue in the future, and can treat
AnimationValue as a wrapper of RawServoAnimationValue to hide the FFIs
at that moment. For now, we still need both types, so it's better to make sure
they are mutually exclusive in AnimationValue. Therefore, let's add some
assertions.

Besides, I think those FFIs might do many things and it seems those methods
are not critical, so let's move them into the cpp file, so we can remove
some dependencies to avoid re-compiling so many files if someone needs
revise ServoBindings.h.

MozReview-Commit-ID: FJ1uTvEQ7NT

--HG--
extra : rebase_source : 8ef99c659f2721c8425364051db19b66536bccc6
2017-03-31 17:46:37 +08:00
Hiroyuki Ikezoe
af52995ddf Bug 1351981 - Remove annotation for crashtests that are supposed to be run on the compositor. r=boris
MozReview-Commit-ID: 9KaPq7sa5UB

--HG--
extra : rebase_source : 81486f79bba74322cdd658636317fd46cebf94ae
2017-03-30 16:58:04 +09:00
Hiroyuki Ikezoe
089cd10211 Bug 1351981 - Enable crashtest, 1333539-1.html and 1333539-2.html. r=boris
MozReview-Commit-ID: 57JBEHFIQgo

--HG--
extra : rebase_source : a41f815bbf2c9a5362775943ca8d1acf91bf4b16
2017-03-30 16:58:04 +09:00
Hiroyuki Ikezoe
7d3b711ee6 Bug 1351898 - Don't set PropertyValuePair.mValue for stylo. r=birtles
Otherwise we hit below assertion in nsCSSValue::DoReset().

 MOZ_ASSERT(NS_IsInCompositorThread() || !ServoStyleSet::IsInServoTraversal());

PropertyValuePair.mValue was introduced for computing paced timing in the case
where there is some invalid values in keyframes. Paced timing has been removed
removed from the spec and stylo will not support paced timing. So we don't need
to set the value for stylo.

MozReview-Commit-ID: 3I8QSvF2jL8

--HG--
extra : rebase_source : 42155d7fac85aa7fb068e8a514867e8f1c27ed30
2017-03-30 11:08:47 +09:00
Boris Chiou
f4b25f840f Bug 1336769 - Enable crashtests, 1272475-1.html and 1272475-2.html. r=heycam
MozReview-Commit-ID: 5o4ayOHRm4S

--HG--
extra : rebase_source : 0a7f73c1eeddbb7270783de67593f84cc1c5b8ab
2017-03-27 16:25:48 +08:00
Carsten "Tomcat" Book
1bff8bff6d Merge mozilla-central to autoland 2017-03-28 13:06:52 +02:00
Carsten "Tomcat" Book
5b9719c5fc merge mozilla-inbound to mozilla-central a=merge 2017-03-28 13:03:25 +02:00
Brian Birtles
4a53c81f51 Bug 1343589 - Add a test that reverse() updates animations on the compositor r=hiro
MozReview-Commit-ID: FR8kR7TMl33

--HG--
extra : rebase_source : 8cbe75de11323582567d184373f7025c2f133a74
2017-03-28 14:51:53 +09:00
Brian Birtles
3437435375 Bug 1343589 - Add a crashtest for when reverse() throws r=hiro
I have verified that this test fails without the fix from the previous patch.

MozReview-Commit-ID: Hx8D72nTb32

--HG--
extra : rebase_source : 48b53f86fbcf92db6a5d340d2348fe23003aab0f
2017-03-28 14:51:52 +09:00
Brian Birtles
9a4f3fcecb Bug 1343589 - Add animation mutation observer test for reverse() when it throws an exception r=hiro
This patch adds a test that when reverse throws an exception we don't report
anything to animation mutation observers. I have verified that this added test
fails without the early return added to Animation::Reverse() earlier in this
patch series.

MozReview-Commit-ID: 64yX4G7iaIt

--HG--
extra : rebase_source : 3f29335303c969a8e2ad5ac2c16aba276036b434
2017-03-28 14:51:52 +09:00
Brian Birtles
f9b4b144b9 Bug 1343589 - Move setupSynchronousObserver from testcommon.js to test_animation_observers_sync.html r=hiro
This function is only used in test_animation_observers_sync.html. Putting it in
another file makes test_animation_observers_sync.html harder to follow so until
we actually share it with other files we should be it in the one file.

MozReview-Commit-ID: DJXWH4wFWxZ

--HG--
extra : rebase_source : cf5c93f0bee5b03862ad9162c55e1df97b875a6d
2017-03-28 14:51:52 +09:00
Brian Birtles
6c557986cc Bug 1343589 - Add comments to test_animation_observers_[a]sync.html to describe how they differ r=hiro
MozReview-Commit-ID: HxhsaOKDAsq

--HG--
extra : rebase_source : a6d99344126a05a00b33881072e5170845df29e6
2017-03-28 14:51:52 +09:00
Brian Birtles
7a32f654ff Bug 1343589 - Rename animation observer test files r=hiro
As part of this patch series I'd like to add an animation observer test.
However, the current arrangement of test files is quite confusing. We have:

  test_animation_observers.html - Tests that run async only
  test_observers_for_sync_api.html - Tests that can be run synchronously

It's not at all obvious that these are related or that one is related to the
other. In this patch we rename the files so that their relationship is more
obvious. In a subsequent patch we'll add comments to further clarify the
distinction.

MozReview-Commit-ID: CSYL8wruWdK

--HG--
rename : dom/animation/test/chrome/test_animation_observers.html => dom/animation/test/chrome/test_animation_observers_async.html
rename : dom/animation/test/chrome/test_observers_for_sync_api.html => dom/animation/test/chrome/test_animation_observers_sync.html
extra : rebase_source : a8bfde42b9996f172f090e95970e355106757d8a
2017-03-28 14:51:51 +09:00
Brian Birtles
09cda43419 Bug 1343589 - Restore the playbackRate when reverse() throws. r=hiro
MozReview-Commit-ID: FNIZK9yQWyV

--HG--
extra : rebase_source : 32cdcc52ccd8192addc0ed2239f74eb109970597
2017-03-28 14:51:51 +09:00
Wes Kocher
c802acc868 Merge m-c to inbound, a=merge
MozReview-Commit-ID: L6QuPmxL0XP
2017-03-27 17:18:39 -07:00
Christopher Bathgate
8a23013745 Bug 1318223 - Use NonOwningAnimationTarget in OwningElementRef. r=boris, r=birtles
--HG--
extra : amend_source : efe698c05bcee0c34d99b8242d8f147373cf2584
2017-03-26 16:46:00 -04:00
Hiroyuki Ikezoe
0ec76c29e2 Bug 1344966 - Post eRestyle_CSSAnimations instead of eRestyle_Self and eRestyle_Subtree. r=heycam
MozReview-Commit-ID: 7azwzIPc45X

--HG--
extra : rebase_source : 5943ab5db1a0a7ca4e77f9373151a5d1387ab25f
2017-03-27 06:17:08 +09:00
Hiroyuki Ikezoe
3183fa83ee Bug 1350754 - Templatize EffectCompositor::UpdateEffectProperties. r=birtles
We will use this function for stylo computed values as well.

MozReview-Commit-ID: IxDg4EZARi3

--HG--
extra : rebase_source : dc6445ab0c836393913d64313c8151f31cd7b523
2017-03-27 19:43:04 +09:00
Hiroyuki Ikezoe
2e2e70805e Bug 1350743 - Rename AnimationPropertySegment::HasReplacableValues to AnimationPropertySegment::HasReplaceableValues. r=birtles
MozReview-Commit-ID: KNwZhFvG5PJ

--HG--
extra : rebase_source : 28819462a86d1ad2050314dc7a5f5a68e69bf7b9
2017-03-27 09:15:26 +09:00
Hiroyuki Ikezoe
7b0ef88536 Bug 1350743 - Re-use nsStyleContext without animations to extract animation values for each property. r=birtles
MozReview-Commit-ID: L4AmCAp0DLn

--HG--
extra : rebase_source : 568be90539c7ffb0c47e03c4a8d1687e5560e87d
2017-03-27 09:15:26 +09:00
Hiroyuki Ikezoe
f63f144516 Bug 1350743 - Make KeyframeEffectReadOnly::ResolveBaseStyle return void. r=birtles
Also it's renamed to EnsureBaseStyle.  We didn't use the return value at all.

MozReview-Commit-ID: Cu4rnAP883M

--HG--
extra : rebase_source : 1ced02e7ebd6a3c6c66c45f4a2a0b24e0bce6031
2017-03-27 09:15:26 +09:00
Ting-Yu Lin
4e375689c6 Bug 1322570 Part 4 - Use GetParentAllowServo() in KeyframeEffectReadOnly::UpdateProperties. r=hiro
Per bug 1322570 Comment 7, we could drop the GetParentAllowServo() when we
invoke UpdateProperties() from a SquentialTask, so allow it for now.

MozReview-Commit-ID: 52NauGaz4Zv

--HG--
extra : rebase_source : 617c3310a042ca49023ebad1801a2c283e4e212c
2017-03-20 14:13:01 +08:00
Mats Palmgren
2dd8c9d161 Bug 1333482 part 6 - [css-ui] Manually tweak some tests for 'appearance' changes. r=dholbert
MozReview-Commit-ID: 9cBAQIeS2TG
2017-03-23 22:11:25 -07:00
Wes Kocher
8fb7d84cb4 Merge inbound to central, a=merge
MozReview-Commit-ID: FKkx5SygvHz
2017-03-21 16:08:32 -07:00
Cameron McCormack
cf56de72b5 Bug 1302054 - Part 2: Remove no longer useful nsStyleContext::CalcDifference optimization that handles the same-rule-node case. r=dbaron
nsStyleContext::CalcDifference had an optimization where, when we knew
that the old and new style context have the same rule node, we knew that
the only change hints that would need to be handled are those in the
"not handled for descendants" category, generated due to explicit
'inherit' values on reset properties.  This was because any changes due
to differences in inherited properties should only have generated
"handled for descendants" change hints (and thus would already have been
handled on an ancestor).

Before bug 931668, this let us avoid calling CalcDifference on structs
that only would have generated hints that we knew we already would have
handled.  However, after bug 931668, we compare all structs anyway so
that we can set the aEqualStructs outparam, so we don't gain anything
from this optimization.  We can still return these change hints we know
will not need to be handled, and rely on ElementRestyler::CaptureChange
to filter them out.

MozReview-Commit-ID: Ld1s2Js0i6r
2017-03-21 16:33:05 +08:00
Boris Chiou
384142c233 Bug 1343153 - Part 2: Use Servo css-parser for ParseEasing. r=birtles,emilio
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.

MozReview-Commit-ID: FsfHQaNT2xO

--HG--
extra : rebase_source : 8eb6489f257839f2c0de943b63cc1c04b44ff7a5
2017-03-21 14:27:46 +08:00
Boris Chiou
5daf1f2b75 Bug 1343153 - Part 1: Add some useful constructors for ComputedTimingFunction. r=birtles
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.

MozReview-Commit-ID: I8zmWeKl9aw

--HG--
extra : rebase_source : 50a9adc90c26c16fd1dcd7b70c519794b8d406fd
2017-03-17 16:37:49 +08:00
Sebastian Hengst
08eaa88de2 Backed out changeset c5da825e8bd9 (bug 1343153) for timing out in dom/animation/test/crashtests/1278485-1.html, at least on Stylo. r=backout 2017-03-21 11:06:07 +01:00
Sebastian Hengst
1ba83457d7 Backed out changeset 9de875f31238 (bug 1343153) 2017-03-21 11:03:19 +01:00
Boris Chiou
5fdc3654b4 Bug 1349124 - Replace ServoComputedStyleValues with ServoComputedValuesWithParent. r=hiro
MozReview-Commit-ID: 5POa8DRjmc8

--HG--
extra : rebase_source : 5a88f1c30c32dcd6bb728707c066a4b8becfc311
2017-03-21 15:41:23 +08:00
Boris Chiou
bc0746fe3d Bug 1343153 - Part 2: Use Servo css-parser for ParseEasing. r=birtles,emilio
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.

MozReview-Commit-ID: FsfHQaNT2xO

--HG--
extra : rebase_source : f0426f90e4698363b0ce0271943b31418458301d
2017-03-21 14:27:46 +08:00
Boris Chiou
e846f398cc Bug 1343153 - Part 1: Add some useful constructors for ComputedTimingFunction. r=birtles
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.

MozReview-Commit-ID: I8zmWeKl9aw

--HG--
extra : rebase_source : ef3b73e9e8798b2953f7db6ea5bb43ee12403649
2017-03-17 16:37:49 +08:00
Hiroyuki Ikezoe
cb4ce7109c Bug 1340958 - Drop AnimationRule and ServoAnimationRule. r=boris
MozReview-Commit-ID: ClnvyShHpsN

--HG--
extra : rebase_source : c554550264bfedafbf91ed2ed754603fb5c3e4c6
2017-03-17 13:24:42 +09:00
Hiroyuki Ikezoe
3b9f585232 Bug 1340958 - Put computed values into AnimationValueMap instead of hashtable in gecko. r=heycam
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust.  This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.

MozReview-Commit-ID: EJ2Kl65fVeF

--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
2017-03-17 13:23:21 +09:00
Hiroyuki Ikezoe
2511ac5d4e Bug 1340958 - Templatize ComposeStyle. r=birtles
Later in this patch series we will replace ServoAnimationRule with a hashmap.
At that point, we would like to pass the hashmap to ComposeStyle. In order
to achieve that, this patch templatizes the 'animation rule' parameter of
ComposeStyle in both Animation and KeyframeEffectReadOnly so that it can
represent a hashmap instead.

MozReview-Commit-ID: H5bMxjN3W8n

--HG--
extra : rebase_source : 58cd9ee1cda51970d35c52b39d2cdab12055e24a
2017-03-17 13:22:13 +09:00
Hiroyuki Ikezoe
2d5908cdb1 Bug 1340958 - Separate ComposeStyle() into servo and gecko versions. r=birtles
MozReview-Commit-ID: FAXf6J9UVjo

--HG--
extra : rebase_source : 606043e23b478558dd931756c0769dd2ef592b3b
2017-03-17 12:48:56 +09:00
Hiroyuki Ikezoe
faa7a6f3cb Bug 1340958 - Allocate StyleRule only if we need to compose styles. r=birtles
MozReview-Commit-ID: 6ucsxBAaYRp

--HG--
extra : rebase_source : ec0bd4627d40335c353b79720f7dfb2e4f3c304c
2017-03-17 12:48:51 +09:00
Hiroyuki Ikezoe
a3c9c5051e Bug 1340958 - Do not call EffectCompositor::GetServoAnimationRule for print preview. r=heycam
The only one caller of GetServoAnimationRule is Gecko_GetAnimationRule.
There is no risk that pres context is destroyed in Gecko_GetAnimationRule.

MozReview-Commit-ID: 52pxbCiCNoJ

--HG--
extra : rebase_source : 8000e267d1d5706c709f807e11396dda3579c4dc
2017-03-17 12:48:34 +09:00
Hiroyuki Ikezoe
a9a15a1807 Bug 1347806 - Fix pseudo nsIAtom for ::before and ::after. r=birtles
cssPseudoElementBeforeProperty and cssPseudoElementAfterProperty are for
CSSPseudoElement.

MozReview-Commit-ID: 3WETv4QeC5

--HG--
extra : rebase_source : b7e902786ca9ebe7c92a573604e15d868c6067a7
2017-03-16 14:01:44 +09:00
BharatR123
9747fa7418 Bug 1302637 - Animation::PostUpdate() calls KeyframeEffectReadonly::RequestRestyle() r=hiro
Also removed the function GetPresContext() in KeyframeEffectReadOnly.cpp
and KeyframeEffectReadOnly.h

MozReview-Commit-ID: AJCgxQ05yVQ

--HG--
extra : rebase_source : d85db8bf29079964e4210e5b3a381e8483d92441
2017-03-14 22:03:22 +05:30
Boris Chiou
2e1fa78918 Bug 1339704 - Part 2 - Filter out unwanted CascadeLevel::Transitions. r=birtles,hiro
We always call TElement::get_animation_rules() for both cascade levels while
there are animations or transitions, so we want to handle the following cases:
1. Have both CascadeLevel::Animations and CascadeLevel::Transitions:
  * We use EffectSet::mPropertiesForAnimationsLevel to filter out
    CascadeLevel::Transitions because transitions are suppressed when both
    are presented.
2. Have CascadeLevel::Animations, but don't have CascadeLevel::Transitions:
  * We also use EffectSet::mPropertiesForAnimationsLevel to filter out
    the unwanted CascadeLevel::Transitions.
3. Don't Have CascadeLevel::Animations, but have CascadeLevel::Transitions:
  * EffectSet::mPropertiesForAnimationsLevel doesn't work for this case.
    In Gecko, mElementsToRestyle can help us to filter out the unwanted
    CascadeLevel::Animations, However, mElementsToRestyle is cleared in
    Pre-Traversal, so now we rely on the cascade ordering of transitions to
    override animations. I think we still need to optimize this eventually.
4. No animations:
  * EffectSet helps us to check if there is any animations/transitions.

Therefore, we need to call MaybeUpdateCascadeResults(), which updates
mPropertiesForAnimationsLevel, in Pre-Traversal.

MozReview-Commit-ID: IHYw56EX7Ta

--HG--
extra : rebase_source : 4d5eb1335cdce9bf54c9646db1fba72ca3f2c70b
2017-03-13 21:09:50 +08:00
Boris Chiou
a4aedd5a93 Bug 1339704 - Part 1 - Rename nsCSSPropertyIDSet::Invert as Inverse. r=hiro
This makes it more obvious that the object is not being modified but a
new object is being returned.

MozReview-Commit-ID: A6dH8f12h5A

--HG--
extra : rebase_source : b2f8de2e685129552c598a4be499d703e1a73b6b
2017-03-14 11:30:20 +08:00
BharatR123
c57b3be37c Bug 1302888 - Replace GetPresContext() with nsContentUtils::GetContextForContent() to obtain nsPresContext* in dom/animation r=hiro
Edited all function calls in KeyFrameEffectReadOnly.cpp and one function call in EffectCompositor.cpp

MozReview-Commit-ID: BzSHLZna4xX

--HG--
extra : rebase_source : ee5a8196ce73e67308974b7fb5be19f61982320b
2017-03-13 20:39:49 +05:30
Emilio Cobos Álvarez
fb3b444270 Bug 1303229: Get the proper viewport size for animations. r=heycam,hiro
While we're here, don't re-recompute the default computed values, just grab them
from the device.

MozReview-Commit-ID: GqqnPLIwN2F
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-11 14:29:38 +01:00
Hiroyuki Ikezoe
11184fb1e8 Bug 1341985 - Trigger the second traversal for updating CSS animations in the case of Servo_ResolveStyleLazily. r=heycam
MozReview-Commit-ID: 7E4unP9M7FQ

--HG--
extra : rebase_source : ee43d00ab84bcd6071ee7bb4cc1de4438229ea1b
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe
843466ec0d Bug 1341985 - Trigger the second traversal for updating CSS animations. r=birtles,heycam
The restyle request during restyling is a result of creating/updating/removing
CSS animations that will come from a SequentialTask which will be implemented
in a subsequent patch.

MozReview-Commit-ID: JoAqvcN3y51

--HG--
extra : rebase_source : fdff59771b81518509dfd52e73d3f63ddb82390d
2017-03-10 11:53:19 +09:00
Manish Goregaokar
07fc7c5b25 Bug 1329093 - Part 1: stylo: Handle SVG presentation attributes; r=bz
MozReview-Commit-ID: 9cymo3c9HIn
2017-03-09 17:46:21 -08:00
Hiroyuki Ikezoe
11c8680e9d Bug 1344619 - Part 7: Drop EffectCompositor::ClearElementsToRestyle. r=birtles
MozReview-Commit-ID: DlTj2OR0wI0

--HG--
extra : rebase_source : 33307226315e6fb3facb000214e27d5582279dd6
2017-03-09 05:20:17 +09:00
Hiroyuki Ikezoe
9d7c539837 Bug 1344619 - Part 5: Introduce EffectCompositor::PreTraverse() for an element. r=birtles
MozReview-Commit-ID: KCLkwIE8LTM

--HG--
extra : rebase_source : 71aa7d27ad4c3fc59898b97e494e2d7ea43044ad
2017-03-09 05:20:17 +09:00
Hiroyuki Ikezoe
90d73a1135 Bug 1344619 - Part 2: Introduce EffectCompositor::PreTraverse(). r=birtles
MozReview-Commit-ID: 6ijDJttB9eo

--HG--
extra : rebase_source : 451601b1daf37e7b36d0b8ecda71c34388b78412
2017-03-09 05:20:17 +09:00