Commit Graph

1533 Commits

Author SHA1 Message Date
Boris Zbarsky
7a9f022f1a Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot
MozReview-Commit-ID: 7E2KZkLfbSI
2018-02-01 14:26:12 -05:00
Cameron McCormack
2cea1ba7c1 Bug 1430014 - Part 6: #ifdef out a bit more animation-related code. r=hiro
MozReview-Commit-ID: B9TaVJFak26

--HG--
extra : source : 820eed2682b6a6cda892d091ee037ff1eeacd69f
2018-02-01 15:04:04 +11:00
Cameron McCormack
d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack
cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
cku
af86c724c9 Bug 1207734 - Part 4.c. Temporarily disable async-transform for individual-transform. r=birtles
Since we do not support async-transform for individual-transform yet.

MozReview-Commit-ID: gfOzHpjOnQ
(grafted from dd508458f70d5473256a4bfe5a2f6bc665bbac9d)

--HG--
extra : source : dd508458f70d5473256a4bfe5a2f6bc665bbac9d
2018-01-05 14:45:05 +08:00
Hiroyuki Ikezoe
eeefe00d01 Bug 1433008 - Make AnimationEventInfo, InternalTransitionEvent and InternalAnimationEvent movable. r=masayuki
And disallow using copy constructor and copy assignment for the structs.

MozReview-Commit-ID: 7jSktlu1SqN

--HG--
extra : rebase_source : cc8bcb1f95843a2a46a044e226c299a6196ef2a2
2018-01-30 09:26:48 +09:00
Hiroyuki Ikezoe
4d9188d86d Bug 1433846 - Drop nsComputedDOMStyle::GetPresShellForContent(), use nsContentUtils::GetPresShellForContent(). r=xidorn
MozReview-Commit-ID: JcpEpqP32Yi

--HG--
extra : rebase_source : dc3649c882f7edd36f9dbc3463d186517b18bdc1
2018-01-29 14:19:25 +09:00
Hiroyuki Ikezoe
0bb119e341 Bug 1428692 - Don't use tweakExpectedRestyleCount in the case where we don't use the returned count for observeStyling called right after. r=birtles
tweakExpectedRestyleCount() is supposed to work with observeStyle() which is
called right after tweakExpectedRestyleCount().  That's because
tweakExpectedRestyleCount() adjusts the expected restyle count which will
happen in continuous frames that begins from the startsRightNow() call,
especially a redundant restyle might be observed in the last frame if the
animation did not begin at the current timeline time and if the Promise inside
the last requestAnimationFrame is fulfilled after restyling happened.

Instead of using tweakExpectedRestyleCount(), we need to check whether the
animation begun at the current timeline time when the animation started, and if
the animation begun at the current timeline time, we don't observe the
superfluous restyle in a frame after the animation element was re-attached.

MozReview-Commit-ID: 6TLQERSSbjU

--HG--
extra : rebase_source : 1a1dcb56b889bebedb44346bbc315ec01870cf79
2018-01-30 06:41:31 +09:00
Hiroyuki Ikezoe
fedb7434fb Bug 1415780 - Call UpdateTiming() prior to remove the animtion from the timeline in Animation::CancelNoUpdate. r=birtles
Now AnimationEventDispatcher ensures that the refresh driver's next tick
happens for cancel event, so we don't need to re-observe the timeline
(it happens in UpdateTiming) once after removing the animation from the
timeline.

MozReview-Commit-ID: 7ivclmYIkPa

--HG--
extra : rebase_source : 286b3d5d29208496bfe8405819b44b5f52f6671c
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
175bc2d176 Bug 1415780 - Let AnimationEventDispatcher observe nsRefreshDriver. r=birtles
So that we can now ensure nsRefreshDriver ticks (i.e. nsRefreshDriver doesn't
stop its timer) for all queued events.
Before this patch, dispatching CSS animation/transition events relied on the
fact that DocumentTimeline observes nsRefreshDriver.  For this fact,
animationcancel or transitioncancel event did not dispatch properly in some
cases, i.e. the case where the animation was dropped from the DocumentTimeline.

MozReview-Commit-ID: 7JYro0MY2U2

--HG--
extra : rebase_source : 28c8e2a50d29c5344e2c5ca3c43af41f4692fa0f
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
7061542dd0 Bug 1415780 - Make AnimationEventDispatcher::SortEvents() private. r=birtles
Now we sort pending events only when dispatching the events, i.e.
only inside DispatchEvent().

MozReview-Commit-ID: BZbuF8gD39b

--HG--
extra : rebase_source : 2a90697356d980b1fd1329d34936eaef1179d12f
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
7828b6be59 Bug 1415780 - Let nsPresContext have AnimationEventDispatcher. r=birtles
Now we sort CSS animation/transition events by scheduled event time prior
to compositor order.

SortEvents() will be a private method in the next patch in this patch
series.

MozReview-Commit-ID: ICkOayquN0f

--HG--
extra : rebase_source : 405c8232e93c54a073c722a4332873af02daa870
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
21a53275cd Bug 1415780 - Make AnimationEventDispatcher refcountable. r=birtles
In a subsequent patch in this patch series, we want to make nsPresContext
have an AnimationEventDispatcher as RefPtr<>.

Instead, if we were trying to make nsPresContext have the
AnimationEventDispatcher as data object (not RefPtr<>) just like we did in
CommonAnimationManager, we will fall into header inclusion hell since Element.h
includes nsPresContext.h and AnimationEventDispatcher.h ends up including
Element.h.  Even if we could solve the inclusion hell, we will suffer from Rust
bindgen issues for some reasons.

MozReview-Commit-ID: B0nX2JzIRJD

--HG--
extra : rebase_source : 4eb998876b2fc39de8d09cac09c19e1a51cd382e
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
75fc208a71 Bug 1415780 - De-templatize AnimationEventDispatcher. r=birtles,masayuki
Now single AnimationEventDispatcher can handle both CSS animation/transition
events simultaneously.  To do this we had to change AnimationEventInfo and
TransitionEventInfo into a single struct, the struct is also named
AnimationEventInfo.

It results we can sort both CSS animation/transition events altogether.  Thus
we make sure CSS animation/transition events are sorted by scheduled event time
prior to their composite order (i.e. transitions is prior to animations).

At this moment, we don't sort both events altogether since nsAnimationManager
and nsTransitionManager has an AnimationEventDispatcher respectively.  In the
next patch we move AnimationEventDispatcher into nsPresContext, i.e. each
document has an AnimationEventDispatcher without the distinction between
CSS animations and transitions.

Note that, after this patch, we copy all members in InternalTransitionEvent and
InternalAnimationEvent in the copy-constructor of AnimationEventInfo, this
will be fixed once WidgetEvent has move-constructor and move-assignment
(bug 1433008).

MozReview-Commit-ID: 5JAh6N7C6ee

--HG--
extra : rebase_source : 50da76f51cf65cdd1245d93d8b48aaf0ae0ec94b
2018-01-27 21:17:27 +09:00
Hiroyuki Ikezoe
45ef4d82a6 Bug 1415780 - Split AnimationEventDipatcher into an independent file. r=birtles
MozReview-Commit-ID: Fcqtu7G400Z

--HG--
extra : rebase_source : 50de08148dcd4e4db0ea9a9ad1b501718852ca78
2018-01-27 21:17:27 +09:00
Cosmin Sabou
887d9fa276 Backed out 12 changesets (bug 1415780) for build bustages nsRefreshDriver.cpp:1606:1 and AnimationCommon.h:168:51 on a CLOSED TREE
Backed out changeset 1fa2f138319e (bug 1415780)
Backed out changeset 6bad89a17566 (bug 1415780)
Backed out changeset a88250ad7a3e (bug 1415780)
Backed out changeset 43d42ca7308f (bug 1415780)
Backed out changeset 79e980195ee8 (bug 1415780)
Backed out changeset f0cc29e7ccd7 (bug 1415780)
Backed out changeset c6567e4196f6 (bug 1415780)
Backed out changeset ae7be65f3c88 (bug 1415780)
Backed out changeset 621b9aaf4a8f (bug 1415780)
Backed out changeset e298f242ce7c (bug 1415780)
Backed out changeset 027a7ed3c948 (bug 1415780)
Backed out changeset 433a6f0d0ac3 (bug 1415780)
2018-01-27 12:47:29 +02:00
Hiroyuki Ikezoe
2046465f79 Bug 1415780 - Call UpdateTiming() prior to remove the animtion from the timeline in Animation::CancelNoUpdate. r=birtles
Now AnimationEventDispatcher ensures that the refresh driver's next tick
happens for cancel event, so we don't need to re-observe the timeline
(it happens in UpdateTiming) once after removing the animation from the
timeline.

MozReview-Commit-ID: 7ivclmYIkPa

--HG--
extra : rebase_source : d111c63baac0ad3005723c1c76bad08e975555ec
2018-01-27 16:55:46 +09:00
Hiroyuki Ikezoe
51d411f1b6 Bug 1415780 - Let AnimationEventDispatcher observe nsRefreshDriver. r=birtles
So that we can now ensure nsRefreshDriver ticks (i.e. nsRefreshDriver doesn't
stop its timer) for all queued events.
Before this patch, dispatching CSS animation/transition events relied on the
fact that DocumentTimeline observes nsRefreshDriver.  For this fact,
animationcancel or transitioncancel event did not dispatch properly in some
cases, i.e. the case where the animation was dropped from the DocumentTimeline.

MozReview-Commit-ID: 7JYro0MY2U2

--HG--
extra : rebase_source : e1963d9eef996cdf5d64c64f80eb1b93ac6fd18a
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
9e4cc95a63 Bug 1415780 - Make AnimationEventDispatcher::SortEvents() private. r=birtles
Now we sort pending events only when dispatching the events, i.e.
only inside DispatchEvent().

MozReview-Commit-ID: IRqH56BEnKb

--HG--
extra : rebase_source : dd2b8528fdc36d1371815feaf07ead0b258fe453
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
99f98b1bd6 Bug 1415780 - Let nsPresContext have AnimationEventDispatcher. r=birtles
Now we sort CSS animation/transition events by scheduled event time prior
to compositor order.

SortEvents() will be a private method in the next patch in this patch
series.

MozReview-Commit-ID: ICkOayquN0f

--HG--
extra : rebase_source : 52226c33a511451c31d4c3fef94ff02de8462256
2018-01-27 16:55:45 +09:00
Hiroyuki Ikezoe
f61cc0132a Bug 1415780 - Make AnimationEventDispatcher refcountable. r=birtles
In a subsequent patch in this patch series, we want to make nsPresContext
have an AnimationEventDispatcher as RefPtr<>.

Instead, if we were trying to make nsPresContext have the
AnimationEventDispatcher as data object (not RefPtr<>) just like we did in
CommonAnimationManager, we will fall into header inclusion hell since Element.h
includes nsPresContext.h and AnimationEventDispatcher.h ends up including
Element.h.  Even if we could solve the inclusion hell, we will suffer from Rust
bindgen issues for some reasons.

MozReview-Commit-ID: B0nX2JzIRJD

--HG--
extra : rebase_source : cd010ca5fe5b1f9fa8f519fdab0dc47d6e519bef
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
f2ce7c4704 Bug 1415780 - De-templatize AnimationEventDispatcher. r=birtles,masayuki
Now single AnimationEventDispatcher can handle both CSS animation/transition
events simultaneously.  To do this we had to change AnimationEventInfo and
TransitionEventInfo into a single struct, the struct is also named
AnimationEventInfo.

It results we can sort both CSS animation/transition events altogether.  Thus
we make sure CSS animation/transition events are sorted by scheduled event time
prior to their composite order (i.e. transitions is prior to animations).

At this moment, we don't sort both events altogether since nsAnimationManager
and nsTransitionManager has an AnimationEventDispatcher respectively.  In the
next patch we move AnimationEventDispatcher into nsPresContext, i.e. each
document has an AnimationEventDispatcher without the distinction between
CSS animations and transitions.

Note that, after this patch, we copy all members in InternalTransitionEvent and
InternalAnimationEvent in the copy-constructor of AnimationEventInfo, this
will be fixed once WidgetEvent has move-constructor and move-assignment
(bug 1433008).

MozReview-Commit-ID: 5JAh6N7C6ee

--HG--
extra : rebase_source : 06ef844f41cfe81b9a629340b5a328c1bed80e8e
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
cd43017099 Bug 1415780 - Split AnimationEventDipatcher into an independent file. r=birtles
MozReview-Commit-ID: Fcqtu7G400Z

--HG--
extra : rebase_source : e90a03ef74a7c53a068227672f9e727d31d11707
2018-01-27 16:55:44 +09:00
Hiroyuki Ikezoe
3dc42221b8 Bug 1432104 - KeyframeUtils::GetAnimationPropertiesFromKeyframes needs specializations both for GeckoStyleContext* and const ServoStyleContext*. r=birtles
The implementation of the template function is defined in KeyframeUtils.cpp,
whereas the caller is inside KeyframeEffectReadOnly.cpp.  I guess it's been
compiled accidentally because of unified builds.

MozReview-Commit-ID: 9GeIT7nDpLG

--HG--
extra : rebase_source : ce58ac6a013ff45d402c51994eb4f0bc28a2c671
2018-01-22 19:19:41 +09:00
Hiroyuki Ikezoe
2529df076a Bug 1430654 - Use assert_times_equal for comparing timing values. r=birtles
MozReview-Commit-ID: CUn1f8M0jo5

--HG--
extra : rebase_source : 1ac203d28022707f1b34757a1613e6f201a1f706
2018-01-22 14:57:57 +09:00
Hiroyuki Ikezoe
0a91cefd01 Bug 1430654 - Double epsilon value for assert_times_equal. r=birtles
Since the function assumes that both of actual and expected values
have the same precision requirements.

MozReview-Commit-ID: 4C3TAH6mUVg

--HG--
extra : rebase_source : 1e40e489745b0d9047d34e851a5f043db616323e
2018-01-22 14:57:57 +09:00
Hiroyuki Ikezoe
fae9243927 Bug 1430654 - Introduce assert_time_equals_literal and use it. r=birtles
This assertion is supposed to be used where the first argument has a tolerance
but the second argument doesn't have such tolerance.  Whereas
assert_times_equal() is supposed to be used for the case both arguments have
the same tolerance, actually it hasn't, it will be fixed in a subsequent patch
in this patch series.

MozReview-Commit-ID: FEDHilbX2rm

--HG--
extra : rebase_source : e773902b474bd9a411e7bb3f234702a93547ebba
2018-01-22 14:55:16 +09:00
Hiroyuki Ikezoe
5c74787c9b Bug 1431295 - Drop 'undef None' macro in dom/animation/. r=boris
MozReview-Commit-ID: BkV6vCc4rmt

--HG--
extra : rebase_source : 9a1ef446045adeb7bbab6814c147947e30626b29
2018-01-18 14:12:51 +09:00
Wei-Cheng Pan
e8f46bbec4 Bug 1425213 - Unthrottle transform animations regardless in overflowable frames or not. r=hiro
Because we don't know whether the transformed position will be visible or not.
2018-01-17 22:44:00 +02:00
Hiroyuki Ikezoe
fa8cb05830 Bug 1430975 - Don't pass a copy of StickyTimeDuration. r=boris
MozReview-Commit-ID: HlQlMB1FBRi

--HG--
extra : rebase_source : 19888f1aa8cb98ecb1ee0aeaa46c8e4015e12867
2018-01-17 18:05:03 +09:00
Hiroyuki Ikezoe
ddaf0ef84e Bug 1419079 - Don't bail out from CalculateCumulativeChangeHint() in the case of opacity property even if there is a missing keyframe or composite operation is not 'replace'. r=birtles
For opacity property, we only generate nsChangeHint_UpdateUsesOpacity,
nsChangeHint_UpdateOpacityLayer and nsChangeHint_RepaintFrame.  All of them are
included in nsChangeHint_Hints_CanIgnoreIfNotVisible.  So we can throttle
opacity animations on out-of-view elements whatever underlying opacity value is.

MozReview-Commit-ID: FdQJbItAndG

--HG--
extra : rebase_source : d011270e4e3e1adc1782665a592fb3fac60f9174
2018-01-17 11:48:20 +09:00
Hiroyuki Ikezoe
b72cfe5bff Bug 1419079 - Add a test case for additive animation with a missing keyframe. r=birtles
MozReview-Commit-ID: 5UWfDIx7RVi

--HG--
extra : rebase_source : 17c9e62f66c7fef101a6b2a4f93e4348e94721cf
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
cb10669b24 Bug 1419079 - Revise a comment for a test case for missing keyframes. r=birtles
The animation in the test case is not actually additive animation, it's just a
missing keyframe animation and its composite operation is actually 'replace'.

MozReview-Commit-ID: 4A29V5Ke2hF

--HG--
extra : rebase_source : 63b6c7f52943786d06c52b9baa7e0f4f151781ac
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
c5899c8bd2 Bug 1419079 - Drop checking the pref for offscreen throttling. r=birtles
The pref has been enabled by default since firefox 49, so it's not worth
checking the pref in test.

MozReview-Commit-ID: 5ADIFaV1ue

--HG--
extra : rebase_source : 8490cc7988cc1e7fe3a650c4f1334b4ed11c7105
2018-01-17 08:55:00 +09:00
Hiroyuki Ikezoe
65c0f821c8 Bug 1419079 - Drop checking the pref for animations-api core in file_restyles.html. r=birtles
It's already specified to true in test_restyles.html.

MozReview-Commit-ID: JMItunKYwIs

--HG--
extra : rebase_source : d54368a93857d8d2a86220be55091735caa074e9
2018-01-17 08:55:00 +09:00
Brian Birtles
5a753e5e80 Bug 1429671 - Make composite member of Keyframe dictionary objects accept null values; r=bz
This patch reflects the following change to the Web Animations spec:

  abf76745b5

MozReview-Commit-ID: A2GD1igUf5f

--HG--
extra : rebase_source : 8129f6386b144adebc3bf0320ca7d6bfbba7a2e9
2018-01-11 16:20:49 +09:00
Tom Ritter
3af00498bc Bug 1429668 Turn off the reduceTimerPrecision pref for one more test r=hiro
MozReview-Commit-ID: J7F502Oz3Uc

--HG--
extra : rebase_source : 6b9883e72fad25d985ba61a999a4bdd2468784b0
2018-01-10 23:06:04 -06:00
Tom Ritter
2eeb5f801e Bug 1424341 Turn the pref off for existing tests that perform fine-grained timing comparisons r=mrbkap
MozReview-Commit-ID: 4ZyE4ebaCaB

--HG--
extra : rebase_source : 80a138ba722c64885a5f6811d862bdc76389a000
2018-01-10 14:46:34 -06:00
Hiroyuki Ikezoe
606a9e9a90 Bug 1421507 - Throttle animations in position:fixed element that the element is out of view. r=boris,tnikkel
MozReview-Commit-ID: jLvrcVhTKW

--HG--
extra : rebase_source : e2ff1e0158aa5207f86c47088283c22febe84197
2018-01-05 10:30:46 +09:00
Hiroyuki Ikezoe
9b4b9f9e65 Bug 1421507 - Test cases for position:absolute element. r=boris
MozReview-Commit-ID: IRPsvJ5WAQF

--HG--
extra : rebase_source : 5c6988a9af8392cc5abf54e56060dcf9653edffb
2018-01-05 10:30:17 +09:00
Hiroyuki Ikezoe
68625f879b Bug 1427868 - Run skipped test cases for scrolled-out elements on Android. r=birtles
These tests can be passed now, I don't know what fixed them, presumably
bug 1421476 and bug 1379515 fixed it.

MozReview-Commit-ID: 2srFKTWWvK

--HG--
extra : rebase_source : 418d366ade78d5a9994cb9bbbab39c4c0b42a2a4
2018-01-04 15:22:34 +09:00
Hiroyuki Ikezoe
b47d85dec0 Bug 1425009 - Take into account the possibility that the animation begins at the moment when the animation was detached from the document. r=birtles
MozReview-Commit-ID: wbM5JW7v76

--HG--
extra : rebase_source : c7ec443f86c6be573ac443f05fdf38a1ed97eefd
2018-01-04 10:19:08 +09:00
Csoregi Natalia
12c47a01be Merge inbound to mozilla-central r=merge a=merge 2017-12-21 12:01:59 +02:00
Brian Birtles
235c83fc0c Bug 1414000 - Assert that either the pres context is nullptr OR that there are no properties when filling in base styles; r=hiro
The call stack where this assertion would otherwise fail is as follows:

 KeyframeEffectReadOnly::UpdateProperties
   KeyframeEffectReadOnly::DoUpdateProperties
     KeyframeEffectReadOnly::BuildProperties
       KeyframeUtils::GetAnimationPropertiesFromKeyframes
         KeyframeUtils.cpp::GetComputedKeyframeValues
     KeyframeEffectReadOnly::EnsureBaseStyles

In bug 1407898 we made GetComputedKeyframes return an empty list when the pres
context is nullptr so if we get a null pres context in EnsureBaseStyles (which
uses the same method for getting the pres context:
nsContentUtils::GetContextForContent) we know that |aProperties| will be empty.
Also, if |aProperties| is empty we're not going to dereferences |presContext| so
we don't need to assert that it is non-null.

I have not included the crashtest in this patch for the same reason as described
in bug 1407898 comment 6.

MozReview-Commit-ID: 6OZ2yJfRLMV

--HG--
extra : rebase_source : b2a711a54623ea177560cf1b69b3c332654bc938
2017-12-20 17:34:57 +09:00
Hiroyuki Ikezoe
faa768c4fa Bug 1309198 - Test case that document is discarded while Document.getAnimations(). r=smaug 2017-12-21 11:40:23 +09:00
Hiroyuki Ikezoe
76f404fa5c Bug 1425771 - Add a branch in only_one_restyling_after_finish_is_called for the conformant Promise handling. r=birtles
Animation.finish() in a micro task for Animation.ready leads to a restyle and
a redundant restyle due to bug 1415457.  The redundant restyle has been observed
in a single frame without the conformant Promise handling.  But once we have the
conformant Promise handling we can tell it in a later frame.
(see https://bugzilla.mozilla.org/show_bug.cgi?id=1415457#c1 to know what's
going on there)

MozReview-Commit-ID: FoojunfYZ6k

--HG--
extra : rebase_source : 2820dce4513329fb648ef387d58cac469f680a6d
2017-12-18 14:19:39 +09:00
Hiroyuki Ikezoe
263cb0e605 Bug 1425771 - Tweak expected restyle count for the case where the animation begins at the current time. r=birtles
The expected restyle count depends both on animation state and micro task
handling.

If we have the conformant Promise handling and if the animation begins at the
current time, we will observe 1 less restyles than observed frames since we
skip the first restyle in the initial frame.  This represents correctly what
we do and what we *should* do.

If we don't have the conformant Promise handling and if the animation doesn't
begin at the current time, we will observe 1 more restyles than obsered frames
since the Promise in observeStyling (precisely the Promise is inside the
callback for requestAnimationFrame) is fulfilled once after a restyling process
followed by the requestAnimationFrame.

MozReview-Commit-ID: FLhSRx4y1V7

--HG--
extra : rebase_source : 59e2bb2439f69bc1415a441c0b84a81463d8229f
2017-12-18 14:19:26 +09:00
Hiroyuki Ikezoe
605f3607fa Bug 1425771 - Add a another variant of restyling_transform_animations_in_scrolled_out_element for the conformant Promise handling. r=birtles
The test case checks document timeline's currentTime to make sure that we are
in the first frame which happened after 200ms since the animation started.  It
is unfortunate for us from the point of view of restyling that the first frame
includes the restyling process in the frame without the conformant Promise
handling, doesn't include the process with the Promise handling.  So we need
to tweak there depends on the Promise handling.

I did intentionally add the forked version of the function with the same name
since branching depending on the conformant flag inside the original function
will be hard to understand and also we can easily remove the original version
once we have the conformant Promise handling.

FWIW, here is the diff between them:

@@ -365,6 +365,9 @@ waitForAllPaints(() => {

       await SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] });

+      // Make sure we start from the state right after requestAnimationFrame.
+      await waitForFrame();
+
       var parentElement = addDiv(null,
         { style: 'overflow-y: scroll; height: 20px;' });
       var div = addDiv(null,
@@ -379,13 +382,17 @@ waitForAllPaints(() => {
       var markers;
       var now;
       while (true) {
-        markers = await observeStyling(1);
-        // Check restyle markers until 200ms is elapsed.
         now = document.timeline.currentTime;
         if ((now - timeAtStart) >= 200) {
+          // If the current time has elapsed over 200ms since the animation was
+          // created, it means that the animation should have already
+          // unthrottled in this tick, let's see what observes in this tick's
+          // restyling process.
+          markers = await observeStyling(1);
           break;
         }

+        markers = await observeStyling(1);
         is(markers.length, 0,
            'Transform animation running on the element which is scrolled out ' +
            'should be throttled until 200ms is elapsed');

MozReview-Commit-ID: 3WfY6aVnsXk

--HG--
extra : rebase_source : ddf51217f03fc1bfe421c344a7a7811dc591a9af
2017-12-18 14:18:17 +09:00
Hiroyuki Ikezoe
90dcb12748 Bug 1425771 - Add a function to check detect whether have conformant Promise handling and set the flag to represent it. r=birtles
MozReview-Commit-ID: FbzaUBKQ47F

--HG--
extra : rebase_source : ae936432d4ccb3e069608703c586d7134d52d12e
2017-12-18 14:17:44 +09:00
Kartikaya Gupta
4f18e92ffb Bug 1334189 - Enable mochitest-plain for linux64-qr. r=jrmuizel
MozReview-Commit-ID: nbcWhDq5de

--HG--
extra : rebase_source : 25e2c2b8b996ae11cd25dee07d9092ba574a9e40
2017-12-13 18:38:39 -05:00