Commit Graph

635 Commits

Author SHA1 Message Date
Hiroyuki Ikezoe
df1a0e7203 Bug 1444177 - Tweak expected restyle count for the test case where finite animation is unthrottled in out-of-view element. r=birtles
It might be possible that the animation does not start being restyled in the
initial frame.  Eventually we should drop tweakExpectedRestyleCount in bug
1425778 and replace it with a function that waits for animation.ready and waits
to start being restyled something like this;

  async function waitForAnimationReadyToBeRestyled(aAnimation) {
    await aAnimation.ready;

    if (animationStartsRightNow(aAnimation)) {
      await waitForFrame();
    }
  }

MozReview-Commit-ID: ByN25hMAK76

--HG--
extra : rebase_source : 6dd3a44661905ffff7bce748540572df2d40425b
2018-03-19 12:46:23 +09:00
Brian Birtles
ee9982905f Bug 1420320 - Drop dom.animations-api.pending-member.enabled pref; r=bz,hiro
This pref was introduced in case we encountered compatibility issues from
changing the return value of Animation.playState (bug 1412765). Now that the
change to Animation.playState has shipped to release channel without any known
problems we should drop this pref.

MozReview-Commit-ID: CwMWRRtIf6u

--HG--
extra : rebase_source : b26c59a51880406c2b94baad8da2eafeb3ae3202
2018-03-16 12:49:55 +09:00
Mantaroh Yoshinaga
ce9138a07e Bug 1419226 - Part 2. Wait for MozAfterPaint instead of waiting for frames on file_deferred_start.html . r=hiro
This patch will :
 * Create test div element after waiting for document load, then wait for
   painting after it.
 * Change to waiting for MozAfterPaint event without workaround of waiting for
   excessive frames.

MozReview-Commit-ID: 6Ytxln3tJi4

--HG--
extra : rebase_source : ff1ccb0ab155ad7e782ecf43f7768ea67f9b9bcf
2018-03-14 13:27:16 +09:00
Brian Birtles
be4db82113 Bug 1382841 - Rename some test files in dom/animation/test/mozilla to use _ to separate words; r=hiro
This naming convention is described fully in this changeset's grandparent.

MozReview-Commit-ID: 5EBpVrOdxD2

--HG--
rename : dom/animation/test/mozilla/file_discrete-animations.html => dom/animation/test/mozilla/file_discrete_animations.html
rename : dom/animation/test/mozilla/test_discrete-animations.html => dom/animation/test/mozilla/test_discrete_animations.html
rename : dom/animation/test/mozilla/test_moz-prefixed-properties.html => dom/animation/test/mozilla/test_moz_prefixed_properties.html
2018-03-12 16:08:36 +09:00
Brian Birtles
5afe0fbdff Bug 1382841 - Rename test_XXX_to_rename.html files in dom/animation/test to test_XXX.html; r=hiro
See the description in this changeset's parent which describes why we do this in
two steps.

MozReview-Commit-ID: GtO0SCb0UOF

--HG--
rename : dom/animation/test/css-animations/test_animation-cancel_to_rename.html => dom/animation/test/css-animations/test_animation-cancel.html
rename : dom/animation/test/css-animations/test_animation-computed-timing_to_rename.html => dom/animation/test/css-animations/test_animation-computed-timing.html
rename : dom/animation/test/css-animations/test_animation-currenttime_to_rename.html => dom/animation/test/css-animations/test_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-finish_to_rename.html => dom/animation/test/css-animations/test_animation-finish.html
rename : dom/animation/test/css-animations/test_animation-finished_to_rename.html => dom/animation/test/css-animations/test_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-id_to_rename.html => dom/animation/test/css-animations/test_animation-id.html
rename : dom/animation/test/css-animations/test_animation-pausing_to_rename.html => dom/animation/test/css-animations/test_animation-pausing.html
rename : dom/animation/test/css-animations/test_animation-playstate_to_rename.html => dom/animation/test/css-animations/test_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-ready_to_rename.html => dom/animation/test/css-animations/test_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-reverse_to_rename.html => dom/animation/test/css-animations/test_animation-reverse.html
rename : dom/animation/test/css-animations/test_animation-starttime_to_rename.html => dom/animation/test/css-animations/test_animation-starttime.html
rename : dom/animation/test/css-animations/test_animations-dynamic-changes_to_rename.html => dom/animation/test/css-animations/test_animations-dynamic-changes.html
rename : dom/animation/test/css-animations/test_cssanimation-animationname_to_rename.html => dom/animation/test/css-animations/test_cssanimation-animationname.html
rename : dom/animation/test/css-animations/test_document-get-animations_to_rename.html => dom/animation/test/css-animations/test_document-get-animations.html
rename : dom/animation/test/css-animations/test_effect-target_to_rename.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-animations/test_element-get-animations_to_rename.html => dom/animation/test/css-animations/test_element-get-animations.html
rename : dom/animation/test/css-animations/test_event-dispatch_to_rename.html => dom/animation/test/css-animations/test_event-dispatch.html
rename : dom/animation/test/css-animations/test_event-order_to_rename.html => dom/animation/test/css-animations/test_event-order.html
rename : dom/animation/test/css-animations/test_keyframeeffect-getkeyframes_to_rename.html => dom/animation/test/css-animations/test_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-animations/test_pseudoElement-get-animations_to_rename.html => dom/animation/test/css-animations/test_pseudoElement-get-animations.html
rename : dom/animation/test/css-animations/test_setting-effect_to_rename.html => dom/animation/test/css-animations/test_setting-effect.html
rename : dom/animation/test/css-transitions/test_animation-cancel_to_rename.html => dom/animation/test/css-transitions/test_animation-cancel.html
rename : dom/animation/test/css-transitions/test_animation-computed-timing_to_rename.html => dom/animation/test/css-transitions/test_animation-computed-timing.html
rename : dom/animation/test/css-transitions/test_animation-currenttime_to_rename.html => dom/animation/test/css-transitions/test_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-finished_to_rename.html => dom/animation/test/css-transitions/test_animation-finished.html
rename : dom/animation/test/css-transitions/test_animation-pausing_to_rename.html => dom/animation/test/css-transitions/test_animation-pausing.html
rename : dom/animation/test/css-transitions/test_animation-ready_to_rename.html => dom/animation/test/css-transitions/test_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-starttime_to_rename.html => dom/animation/test/css-transitions/test_animation-starttime.html
rename : dom/animation/test/css-transitions/test_csstransition-transitionproperty_to_rename.html => dom/animation/test/css-transitions/test_csstransition-transitionproperty.html
rename : dom/animation/test/css-transitions/test_document-get-animations_to_rename.html => dom/animation/test/css-transitions/test_document-get-animations.html
rename : dom/animation/test/css-transitions/test_effect-target_to_rename.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/animation/test/css-transitions/test_element-get-animations_to_rename.html => dom/animation/test/css-transitions/test_element-get-animations.html
rename : dom/animation/test/css-transitions/test_event-dispatch_to_rename.html => dom/animation/test/css-transitions/test_event-dispatch.html
rename : dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes_to_rename.html => dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes.html
rename : dom/animation/test/css-transitions/test_pseudoElement-get-animations_to_rename.html => dom/animation/test/css-transitions/test_pseudoElement-get-animations.html
rename : dom/animation/test/css-transitions/test_setting-effect_to_rename.html => dom/animation/test/css-transitions/test_setting-effect.html
rename : dom/animation/test/document-timeline/test_document-timeline_to_rename.html => dom/animation/test/document-timeline/test_document-timeline.html
rename : dom/animation/test/mozilla/test_cubic_bezier_limits_to_rename.html => dom/animation/test/mozilla/test_cubic_bezier_limits.html
rename : dom/animation/test/mozilla/test_disabled_properties_to_rename.html => dom/animation/test/mozilla/test_disabled_properties.html
rename : dom/animation/test/mozilla/test_hide_and_show_to_rename.html => dom/animation/test/mozilla/test_hide_and_show.html
rename : dom/animation/test/mozilla/test_restyling_xhr_doc_to_rename.html => dom/animation/test/mozilla/test_restyling_xhr_doc.html
rename : dom/animation/test/mozilla/test_transform_limits_to_rename.html => dom/animation/test/mozilla/test_transform_limits.html
rename : dom/animation/test/style/test_animation-seeking-with-current-time_to_rename.html => dom/animation/test/style/test_animation-seeking-with-current-time.html
rename : dom/animation/test/style/test_animation-seeking-with-start-time_to_rename.html => dom/animation/test/style/test_animation-seeking-with-start-time.html
rename : dom/animation/test/style/test_animation-setting-effect_to_rename.html => dom/animation/test/style/test_animation-setting-effect.html
rename : dom/animation/test/style/test_composite_to_rename.html => dom/animation/test/style/test_composite.html
rename : dom/animation/test/style/test_missing-keyframe-on-compositor_to_rename.html => dom/animation/test/style/test_missing-keyframe-on-compositor.html
rename : dom/animation/test/style/test_missing-keyframe_to_rename.html => dom/animation/test/style/test_missing-keyframe.html
2018-03-12 16:08:35 +09:00
Brian Birtles
d0f7ad72a1 Bug 1382841 - Remove old test_XXX openers from dom/animation/test/**; r=hiro
We rename the file_XXX contents to test_XXX_to_rename so that these tests keep
running (so long as they begin with file_ and not test_ the test harness will
refuse to run them). If we rename these files to test_XXX in the same patch
Mercurial will not treat this as a rename and so we will lose the history
associated with file_XXX.

Instead, we rename test_XXX_to_rename to test_XXX in the next patch in this
series and by doing this Mercurial will treat this as two rename operations and
`hg log -f test_XXX` will show the history file_XXX as well.

One minor exception to this occurs due to the fact that we have two naming
conventions:

  (a) For tests in css-animations, css-transitions, style etc.

      Most of these tests should eventually land in web-platform-tests. However,
      in many cases that's not yet possible because, for example, CSS
      Animations 2 does not yet specify the behavior tested by the
      css-animations tests.

      For tests in web-platform-tests we generally separate words using -.
      However, our mochitest running machinery requires that tests begin with
      test_. Hence we name tests: test_abc-def-ghi.html.

  (b) For tests in mozilla

      These tests are never intended to be part of web-platform-tests and
      generally for mochitests we use _ to separate words (hence the test_
      prefix). Hence we name these tests test_abc_def_ghi.html

Now, there are some tests in the 'mozilla' directory that use the (a) naming
scheme instead of (b). In this case, instead of renaming file_xxx-xxx.html to
test_xxx-xxx_to_rename.html in this patch, and then renaming
test_xxx-xxx_to_rename.html to test_xxx-xxx.html in a second patch, we can just
delete test_xxx-xxx.html and rename file_xxx-xxx.html to test_xxx_xxx.html in
the one patch and Mercurial will recognize this as a rename because the file
names don't overlap.

MozReview-Commit-ID: Etcdmyfx0zf

--HG--
rename : dom/animation/test/css-animations/file_animation-cancel.html => dom/animation/test/css-animations/test_animation-cancel_to_rename.html
rename : dom/animation/test/css-animations/file_animation-computed-timing.html => dom/animation/test/css-animations/test_animation-computed-timing_to_rename.html
rename : dom/animation/test/css-animations/file_animation-currenttime.html => dom/animation/test/css-animations/test_animation-currenttime_to_rename.html
rename : dom/animation/test/css-animations/file_animation-finish.html => dom/animation/test/css-animations/test_animation-finish_to_rename.html
rename : dom/animation/test/css-animations/file_animation-finished.html => dom/animation/test/css-animations/test_animation-finished_to_rename.html
rename : dom/animation/test/css-animations/file_animation-id.html => dom/animation/test/css-animations/test_animation-id_to_rename.html
rename : dom/animation/test/css-animations/file_animation-pausing.html => dom/animation/test/css-animations/test_animation-pausing_to_rename.html
rename : dom/animation/test/css-animations/file_animation-playstate.html => dom/animation/test/css-animations/test_animation-playstate_to_rename.html
rename : dom/animation/test/css-animations/file_animation-ready.html => dom/animation/test/css-animations/test_animation-ready_to_rename.html
rename : dom/animation/test/css-animations/file_animation-reverse.html => dom/animation/test/css-animations/test_animation-reverse_to_rename.html
rename : dom/animation/test/css-animations/file_animation-starttime.html => dom/animation/test/css-animations/test_animation-starttime_to_rename.html
rename : dom/animation/test/css-animations/file_animations-dynamic-changes.html => dom/animation/test/css-animations/test_animations-dynamic-changes_to_rename.html
rename : dom/animation/test/css-animations/file_cssanimation-animationname.html => dom/animation/test/css-animations/test_cssanimation-animationname_to_rename.html
rename : dom/animation/test/css-animations/file_document-get-animations.html => dom/animation/test/css-animations/test_document-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_effect-target.html => dom/animation/test/css-animations/test_effect-target_to_rename.html
rename : dom/animation/test/css-animations/file_element-get-animations.html => dom/animation/test/css-animations/test_element-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_event-dispatch.html => dom/animation/test/css-animations/test_event-dispatch_to_rename.html
rename : dom/animation/test/css-animations/file_event-order.html => dom/animation/test/css-animations/test_event-order_to_rename.html
rename : dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html => dom/animation/test/css-animations/test_keyframeeffect-getkeyframes_to_rename.html
rename : dom/animation/test/css-animations/file_pseudoElement-get-animations.html => dom/animation/test/css-animations/test_pseudoElement-get-animations_to_rename.html
rename : dom/animation/test/css-animations/file_setting-effect.html => dom/animation/test/css-animations/test_setting-effect_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-cancel.html => dom/animation/test/css-transitions/test_animation-cancel_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-computed-timing.html => dom/animation/test/css-transitions/test_animation-computed-timing_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-currenttime.html => dom/animation/test/css-transitions/test_animation-currenttime_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-finished.html => dom/animation/test/css-transitions/test_animation-finished_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-pausing.html => dom/animation/test/css-transitions/test_animation-pausing_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-ready.html => dom/animation/test/css-transitions/test_animation-ready_to_rename.html
rename : dom/animation/test/css-transitions/file_animation-starttime.html => dom/animation/test/css-transitions/test_animation-starttime_to_rename.html
rename : dom/animation/test/css-transitions/file_csstransition-transitionproperty.html => dom/animation/test/css-transitions/test_csstransition-transitionproperty_to_rename.html
rename : dom/animation/test/css-transitions/file_document-get-animations.html => dom/animation/test/css-transitions/test_document-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_effect-target.html => dom/animation/test/css-transitions/test_effect-target_to_rename.html
rename : dom/animation/test/css-transitions/file_element-get-animations.html => dom/animation/test/css-transitions/test_element-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_event-dispatch.html => dom/animation/test/css-transitions/test_event-dispatch_to_rename.html
rename : dom/animation/test/css-transitions/file_keyframeeffect-getkeyframes.html => dom/animation/test/css-transitions/test_keyframeeffect-getkeyframes_to_rename.html
rename : dom/animation/test/css-transitions/file_pseudoElement-get-animations.html => dom/animation/test/css-transitions/test_pseudoElement-get-animations_to_rename.html
rename : dom/animation/test/css-transitions/file_setting-effect.html => dom/animation/test/css-transitions/test_setting-effect_to_rename.html
rename : dom/animation/test/document-timeline/file_document-timeline.html => dom/animation/test/document-timeline/test_document-timeline_to_rename.html
rename : dom/animation/test/mozilla/file_cubic_bezier_limits.html => dom/animation/test/mozilla/test_cubic_bezier_limits_to_rename.html
rename : dom/animation/test/mozilla/file_disabled_properties.html => dom/animation/test/mozilla/test_disabled_properties_to_rename.html
rename : dom/animation/test/mozilla/file_document-timeline-origin-time-range.html => dom/animation/test/mozilla/test_document_timeline_origin_time_range.html
rename : dom/animation/test/mozilla/file_hide_and_show.html => dom/animation/test/mozilla/test_hide_and_show_to_rename.html
rename : dom/animation/test/mozilla/file_restyling_xhr_doc.html => dom/animation/test/mozilla/test_restyling_xhr_doc_to_rename.html
rename : dom/animation/test/mozilla/file_set-easing.html => dom/animation/test/mozilla/test_set_easing.html
rename : dom/animation/test/mozilla/file_transform_limits.html => dom/animation/test/mozilla/test_transform_limits_to_rename.html
rename : dom/animation/test/mozilla/file_underlying-discrete-value.html => dom/animation/test/mozilla/test_underlying_discrete_value.html
rename : dom/animation/test/style/file_animation-seeking-with-current-time.html => dom/animation/test/style/test_animation-seeking-with-current-time_to_rename.html
rename : dom/animation/test/style/file_animation-seeking-with-start-time.html => dom/animation/test/style/test_animation-seeking-with-start-time_to_rename.html
rename : dom/animation/test/style/file_animation-setting-effect.html => dom/animation/test/style/test_animation-setting-effect_to_rename.html
rename : dom/animation/test/style/file_composite.html => dom/animation/test/style/test_composite_to_rename.html
rename : dom/animation/test/style/file_missing-keyframe-on-compositor.html => dom/animation/test/style/test_missing-keyframe-on-compositor_to_rename.html
rename : dom/animation/test/style/file_missing-keyframe.html => dom/animation/test/style/test_missing-keyframe_to_rename.html
2018-03-12 16:08:35 +09:00
Hiroyuki Ikezoe
93d38258f6 Bug 1442817 - Don't flush throttled animations on getAnimations(). r=birtles
If the element has throttled animations that will be affected by pending style
changes, the throttled animations will be updated though sequential tasks after
normal styling process.  E.g. UpdateEffectProperties, UpdateCascadeResults etc.
So we don't need to flush them in advance of the sequential tasks.

The first test case in this patch fails without this fix.

MozReview-Commit-ID: GystAqK2bQE

--HG--
extra : rebase_source : c01160e14bb5a2984dcc4d63ec44d4d465b829a2
2018-03-09 09:38:40 +09:00
Hiroyuki Ikezoe
a4c94de97f Bug 1442817 - Introduce a function to observe synchronous restyling easily. r=birtles
In the subsequent patch, we want to observe animation restyles caused by
synchronous styling.  If we used the original asynchronous observer for that,
we will observe restyles in normal scheduled styling, it's bit confusing.

MozReview-Commit-ID: 1V2IavKNECG

--HG--
extra : rebase_source : ee112acf2426ecf54435f77b8801a6228318459c
2018-03-09 06:41:35 +09:00
Hiroyuki Ikezoe
573dfe44a6 Bug 1437272 - Don't throttle finite transform animations in out-of-view element. r=birtles
Transform animation in out-of-view element might move in visible area so if we
throttle it the transform animation might come in view suddenly.  So we don't
throttle transform animations in ouf-of-view element anymore if it's not
infinite.  Finite animations don't last so that they won't consume CPU so much
time.

MozReview-Commit-ID: HaMjmxqXPIK

--HG--
extra : rebase_source : 1c008e4e435bcc9c1ad8fcc84667080247c0b161
2018-03-08 18:22:45 +09:00
Hiroyuki Ikezoe
97b67fe961 Bug 1442150 - Re-enable test_running_on_compositor.html on Android. r=birtles
Now the test works fine with the new microtask handling.

MozReview-Commit-ID: EhFcN2XAClw

--HG--
extra : rebase_source : f1066bf09df07c1bcbfe5dc5dcc59596530424d0
2018-03-06 11:01:49 +09:00
Hiroyuki Ikezoe
795bd7d475 Bug 1442150 - Wait for one more frame if the animation starts at the current timeline time in the first test case. r=birtles
MozReview-Commit-ID: DVOiauPDqhM

--HG--
extra : rebase_source : 2e9dfd0b7dbef48e92fbe48a5166ec6f3aafcabf
2018-03-06 10:55:05 +09:00
Hiroyuki Ikezoe
16a0b8373a Bug 1442150 - Move startsRightNow into testcommon.js and rename it to animationStartsRightNow. r=birtles
MozReview-Commit-ID: 58umbOjy4di

--HG--
extra : rebase_source : eb6810658f09c848c38e11f7872fb7326021f1a3
2018-03-06 10:35:26 +09:00
Hiroyuki Ikezoe
4bc9a2e83a Bug 1442150 - Rewrite test_running_on_compositor.html with async/await. r=birtles
MozReview-Commit-ID: Cdk7kQWcbXU

--HG--
extra : rebase_source : cc9b0e753c6b7804c7f0233cab0a2d3135118f28
2018-03-06 10:35:26 +09:00
Hiroyuki Ikezoe
0206c630c9 Bug 1428693 - Use GetOverflowAreasRelativeToSelf() instead of GetOverflowAreas() for scrollable parent. r=mattwoodrow
Because the scrollable parent might be transformed by its ancestors.

MozReview-Commit-ID: FuCPLg54z7h

--HG--
extra : rebase_source : 7c11c5384d2aed6c663b915fcacae7c627052a43
2018-03-05 07:55:32 +09:00
Hiroyuki Ikezoe
a1d3f36a83 Bug 1442150 - Skip test_running_on_compositor.html on Android. r=arai
It seems that the test starts failing after bug 1193394.
2018-03-01 00:06:00 +09:00
Hiroyuki Ikezoe
6d345d0f0c Bug 1439485 - Don't try to unthrottle transform animations that don't affect overflow region. r=birtles
MozReview-Commit-ID: AtQPiPnsC3z

--HG--
extra : rebase_source : fd9ee5f5a863237c7993d771e30c20921fe86ae2
2018-02-27 14:46:32 +09:00
Tom Ritter
ba2d560b34 Bug 1430841 Re-enable the Reduce Timer Precision pref for CSS Animations tests r=birtles
Currently CSS Animations are exempted from Reduce Timer Precision, so this isn't needed.
Additionally, when we test by overriding that restriction, these tests aren't run, which
leads to confusion.

MozReview-Commit-ID: Gv6T3oGO475

--HG--
extra : rebase_source : 6bd70341fe5d047b685cae0db2965bf86116b4a0
2018-02-16 15:45:33 -06:00
Hiroyuki Ikezoe
ad663efa0b Bug 1439428 - Call UpdateCascadeResults() directly instead of RestyleRestyle() at the end of Gecko_UpdateAnimations(). r=birtles
Calling RequestRestyle() for update cascade results is weird since in general
RequestRestyle() is a result of updating cascade results (e.g. when an
!important style is changed).  In the case where we already know that we need
to update cascade results we can do it right after all the other processes that
may need to update cascade results has done so that we don't need to worry about
the cases additional cascade results update happens.

MozReview-Commit-ID: 6lh0NgTPF9j

--HG--
extra : rebase_source : 4dbec85f55a14776907b677f2876421abc141384
2018-02-23 09:05:26 +09:00
Hiroyuki Ikezoe
8f3060510e Bug 1439269 - Call RequestRestyle() if the display property is changed from 'none' in the case the element has script animations. r=birtles
MozReview-Commit-ID: 1anUTbvw3k4

--HG--
extra : rebase_source : 68ca22f8db7112ac3d73c5331ff39b0780cece6e
2018-02-22 09:10:00 +09:00
Hiroyuki Ikezoe
467ed67c74 Bug 1388557 - Call RequestRestyle(Layer) in the case where we attach orphaned animating element to the document. r=birtles
MozReview-Commit-ID: IIcyYFROqDx

--HG--
extra : rebase_source : f096635d400528660d5243d2884d125e7b623db2
2018-02-21 10:13:13 +09:00
Hiroyuki Ikezoe
4606fafb88 Bug 1417354 - Clear pending restyle requests for the element and its pseudos where the element is detached from the document. r=hiro
MozReview-Commit-ID: GLHjtHNusuB

--HG--
extra : rebase_source : aaf05c7773d11cf61a28803d4ba70546c2b98e27
2018-02-21 07:00:20 +09:00
Tooru Fujisawa
9a81f2437f Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:

1. GlobalObject::CallerType(), that is ultimately passed to
   nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
   to decide whether to copy mIterationComposite/mComposite to
   KeyframeEffectParams.

   GlobalObject::CallerType() can now be different than the target window's one,
   if the caller has the system principal and the target is web content, and
   in that case nsDocument::IsWebAnimationsEnabled there always returns true
   while Web Animations can be disabled on web content.

   honoring the mIterationComposite/mComposite properties is OK, since it just
   changes the animation behavior, and this is disabled by default until
   remaining spec issues are resolved.

2. GlobalObject::Context(), that is ultimately passed to
   KeyframeUtils::GetKeyframesFromObject and used while extracting information
   from passed-in keyframe object, with iterable/iterator protocols.

   Performing that operation in the caller side is okay, since the same thing
   can be done on caller, and the operation doesn't perform any GCThing
   allocation on the target window global.
2018-02-17 17:21:13 +09:00
Tooru Fujisawa
d70a10cbd8 Backed out changeset c3f16a179c93 (bug 1414674) 2018-02-18 01:24:08 +09:00
Tooru Fujisawa
d58a217b1c Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:

1. The target window global is used for most operation:
     * KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
       global instead of current global.
     * KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`

   In Xray case, Web Animations API can be disabled on web content
   (currently disabled on beta/release by default), and in that case some API
   won't work even it's triggered from WebExtensions, but it should be fine.

2. GetKeyframesFromObject is executed in the caller's compartment to access
   the passed-in JSObject that is keyframe, with iterable/iterator protocols.
   This operation doesn't perform any GCThing allocation on the target window
   global.
2018-02-17 17:21:13 +09:00
Hiroyuki Ikezoe
54a0194045 Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio
This patch does basically throttle animations on visibility:hidden element
and unthrottle it once the animating element became visible or a child of the
animating element became visible.  But still there are some cases that we don't
throttle such animations perfectly.  For example;

  div.style.visibility = 'hidden'; // the 'div' has no children at this moment
  div.animate(..);
  // The animation is throttled

  div.appendChild(visibleChild);
  // The animation isn't throttled

  visibleChild.style.visibility = 'hidden';
  // Now the animation should be throttled again, but actually it's not.

To throttle this case properly, when the |visibleChild|'s visibility changed
to hidden, we would need to do either

 1) Check all siblings of the |visibleChild| have no visible children

or

 2) The parent element stores visible children count somewhere and decrease it
    and check whether the count is zero

To achieve 1) we need to walk up ancestors and their siblings, actually it's
inefficient.

2) is somewhat similar to what we already do for animating images but it's hard
to reuse it for CSS animations since it does not take into account that
descendants' visibilities.

Another example that this patch does not optimize is the the case where
animating element has children whose visibility is inherited and the element
itself initially visible something like this;

  let child = document.createElement('div'); // child visibility is 'inherit'
  div.appendChild(child);

  div.animate(..); // the 'div' is visible
  // The animation isn't throttled since the animating element is visible

  div.style.visiblily = 'hidden';
  // Now the animation should be throttled, but it's not since this patch does
  // not descend down all descendants to check they are invisible or not when the
  // animating element visibility changed to hidden.

This patch adds a test case for this case introduced with todo_is().

Another test case added in this patch fails if we don't use
nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants().

MozReview-Commit-ID: BJwzQvP9Yc4

--HG--
extra : rebase_source : e56505706bb2799b59bbfb3bbcce4a9ce86892f4
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
024e9bf76c Bug 1237454 - Test for an animation on visibility: hidden element which has grandchild. r=boris
MozReview-Commit-ID: C0yLy4clwbY

--HG--
extra : rebase_source : f535ab7c981ae4574cbd4ae5e4cf92f08f43679a
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
2b3923c536 Bug 1237454 - Test for an animation on a visibility:hidden element which has a child. r=boris
MozReview-Commit-ID: AfmQJThhp8d

--HG--
extra : rebase_source : b693600cee1ed166b8a4104bd0566c425abbc2ab
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
b9fbc876db Bug 1237454 - Test for an animation in the parent element whose visibility is changed. r=boris
MozReview-Commit-ID: BBMOuPimlPH

--HG--
extra : rebase_source : 68f045fbe4e72b3ce8cc344058f3ae561637468d
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
ed45df9024 Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r=boris
MozReview-Commit-ID: 2Lvk2IqEaXY

--HG--
extra : rebase_source : 710553c6e404afe8a948171d1263c03b9d79e21e
2018-02-09 10:43:10 +09:00
Hiroyuki Ikezoe
40907715ce Bug 1237454 - Add VisibilityChange change hint. r=emilio
This new change hint doesn't influence layout so that it can be regarded
as nsChangeHint_Hints_CanIgnoreIfNotVisible.  Note that if visibility changed
from collapse or to collapse, we set NS_STYLE_HINT_REFLOW separetely.

MozReview-Commit-ID: AirDWeBYVKG

--HG--
extra : rebase_source : a462845ac2d8280986bb8db5e6482bf401f65322
2018-02-09 10:43:10 +09:00
Tom Ritter
aa82f54ab6 Bug 1435296 Address test failures caused by bumping timer precision to 2 ms r=baku
There are a few different reasons why tests needed updating (not an exhaustive list):

- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.

In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648

An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)

In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.

MozReview-Commit-ID: J59c7xQtZZJ

--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
2018-02-12 11:39:41 -06:00
Hiroyuki Ikezoe
d72d0dee6b Bug 1436642 - Make target element size larger to be unable to send transform animations to the compositor. r=jaws
The original value were too small for Android.

MozReview-Commit-ID: 4V6qC8orYNJ

--HG--
extra : rebase_source : 55ea0525bfaafa60d8e5d711cc70dd29d21acc78
2018-02-10 06:52:23 +09:00
Hiroyuki Ikezoe
f22da31267 Bug 1437248 - Disable privacy.reduceTimerPrecision on test_restyles.html. r=arai
In this test we need to know precise time for checking that we unthrottle
throttled transform animations periodically.

MozReview-Commit-ID: ICLf448KFLr

--HG--
extra : rebase_source : 26128735231679031bd1e727cf9d9016054e7664
2018-02-10 15:31:05 +09:00
Narcis Beleuzu
b0e8772dcd Backed out 6 changesets (bug 1237454) for bc failures on /browser_toolbariconcolor_restyles.js. CLOSED TREE
Backed out changeset f8d771835fd2 (bug 1237454)
Backed out changeset 2dbbfc331bdf (bug 1237454)
Backed out changeset c481f409feaa (bug 1237454)
Backed out changeset 0b9872865f0e (bug 1237454)
Backed out changeset 43ca55e7c93b (bug 1237454)
Backed out changeset 027b0c65d944 (bug 1237454)
2018-02-06 11:19:56 +02:00
Hiroyuki Ikezoe
835e2883de Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio
This patch does basically throttle animations on visibility:hidden element
and unthrottle it once the animating element became visible or a child of the
animating element became visible.  But still there are some cases that we don't
throttle such animations perfectly.  For example;

  div.style.visibility = 'hidden'; // the 'div' has no children at this moment
  div.animate(..);
  // The animation is throttled

  div.appendChild(visibleChild);
  // The animation isn't throttled

  visibleChild.style.visibility = 'hidden';
  // Now the animation should be throttled again, but actually it's not.

To throttle this case properly, when the |visibleChild|'s visibility changed
to hidden, we would need to do either

 1) Check all siblings of the |visibleChild| have no visible children

or

 2) The parent element stores visible children count somewhere and decrease it
    and check whether the count is zero

To achieve 1) we need to walk up ancestors and their siblings, actually it's
inefficient.

2) is somewhat similar to what we already do for animating images but it's hard
to reuse it for CSS animations since it does not take into account that
descendants' visibilities.

Another example that this patch does not optimize is the the case where
animating element has children whose visibility is inherited and the element
itself initially visible something like this;

  let child = document.createElement('div'); // child visibility is 'inherit'
  div.appendChild(child);

  div.animate(..); // the 'div' is visible
  // The animation isn't throttled since the animating element is visible

  div.style.visiblily = 'hidden';
  // Now the animation should be throttled, but it's not since this patch does
  // not descend down all descendants to check they are invisible or not when the
  // animating element visibility changed to hidden.

This patch adds a test case for this case introduced with todo_is().

Another test case added in this patch fails if we don't use
nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants().

MozReview-Commit-ID: BJwzQvP9Yc4

--HG--
extra : rebase_source : ceb95bdce1042cbfc16751d6d023fc6feee5845e
2018-02-06 08:43:53 +09:00
Hiroyuki Ikezoe
dd32a9658a Bug 1237454 - Test for an animation on visibility: hidden element which has grandchild. r=boris
MozReview-Commit-ID: C0yLy4clwbY

--HG--
extra : rebase_source : 0203237cf1bc45941188393e7d9ed7e96072ae91
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
6b8d6a0897 Bug 1237454 - Test for an animation on a visibility:hidden element which has a child. r=boris
MozReview-Commit-ID: AfmQJThhp8d

--HG--
extra : rebase_source : ed4abf7fb865cf8459294f086a63b13bf0d57373
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
3f041debf1 Bug 1237454 - Test for an animation in the parent element whose visibility is changed. r=boris
MozReview-Commit-ID: BBMOuPimlPH

--HG--
extra : rebase_source : b73d6890ddf11f58cd7b623f92a73d7e4bd26e08
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
862a7ba92f Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r=boris
MozReview-Commit-ID: 2Lvk2IqEaXY

--HG--
extra : rebase_source : 39cea20c92996b6a785576ded71b5c17f61d3457
2018-02-06 08:43:52 +09:00
Hiroyuki Ikezoe
0de04971ef Bug 1237454 - Add VisibilityChange change hint. r=emilio
This new change hint doesn't influence layout so that it can be regarded
as nsChangeHint_Hints_CanIgnoreIfNotVisible.  Note that if visibility changed
from collapse or to collapse, we set NS_STYLE_HINT_REFLOW separetely.

MozReview-Commit-ID: AirDWeBYVKG

--HG--
extra : rebase_source : 1cd03a78a522b1a6965ba73ebf002ddacb0ab4f2
2018-02-06 08:43:52 +09:00
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
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
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
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
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