Граф коммитов

1586 Коммитов

Автор SHA1 Сообщение Дата
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
Olli Pettay 2439836b37 Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Csoregi Natalia 1fd0486e23 Backed out 7 changesets (bug 1193394) for browser-chrome failures on browser_ext_popup_background.js. CLOSED TREE
Backed out changeset 9683f24ff8ec (bug 1193394)
Backed out changeset 0e7140a7c841 (bug 1193394)
Backed out changeset a0e26f6b2784 (bug 1193394)
Backed out changeset 29e1fceaf48d (bug 1193394)
Backed out changeset b8632bbbd273 (bug 1193394)
Backed out changeset a54ef2d8f896 (bug 1193394)
Backed out changeset 55c94c05c57f (bug 1193394)
2018-03-01 16:29:02 +02:00
Olli Pettay b7726493fb Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08: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
Nathan Froyd 821df39aef Bug 1439723 - use a temporary in Animation::Tick(); r=mattwoodrow 2018-02-26 11:08:55 -05:00
Emilio Cobos Álvarez 7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01: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 77efac4019 Bug 1439428 - Make EffectCompositor::UpdateCascadeResults public. r=birtles
We will call the function directly in a sequential task in the case where we
already detected that !important styles for animations has been changed in
parallel traversal.

MozReview-Commit-ID: 7j6CfONYD08

--HG--
extra : rebase_source : 5ac29124cefbc8e57231d0acb9b1749b2c9587c0
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
Hiroyuki Ikezoe 0ca9f2c309 Bug 1417354 - Add a method to clear all pending restyle requests for a given element and its pseudos. r=birtles
MozReview-Commit-ID: DZkbwUPiPTd

--HG--
extra : rebase_source : b1993ea863a261841be1edfc3b2dee7655123fe8
2018-02-21 07:00:20 +09:00
Hiroyuki Ikezoe 1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +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
Brian Birtles 691e8bbafc Bug 1436659 - Implement pending playback rate mechanism; r=hiro
This reflects the following changes to the Web Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: 3DoaWUkxBTo

--HG--
extra : rebase_source : 032d768b35e3189cd41c38fb4d85a644781a6e33
2018-02-13 15:04:18 +09:00
Brian Birtles 2d967bae1b Bug 1436659 - Add Animation::GetCurrentTimeForHoldTime helper; r=hiro
We will use this to calculate the unconstrained current time when we implement
pending playback rate changes.

MozReview-Commit-ID: 7GlmHiGeXF6

--HG--
extra : rebase_source : 32c0c4d86293bf11220017fa1b126ae239b0301d
2018-02-13 15:04:18 +09:00
Brian Birtles bb7f299f94 Bug 1436659 - Factor out static time calculation methods on Animation; r=hiro
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.

MozReview-Commit-ID: 2HV44TTNxHg

--HG--
extra : rebase_source : 19e32b13c6fee9cfe9993918557f2433aa687e11
2018-02-13 15:04:18 +09:00
Brian Birtles 6255f94834 Bug 1436659 - Add Animation.updatePlaybackRate WebIDL definition; r=bz
This is the IDL added to the Web Animations specification:

  5af5e276ba

Note that some of the changes in the above commit were reverted in the following
commit:

  673f6fc126

A folded version of the changes:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: CJV7bzizXg4

--HG--
extra : rebase_source : 3b168e779883ba91c8f572478185b55013952d1a
2018-02-13 15:04:18 +09:00
arthur.iakab 4139c1f914 Backed out 14 changesets (bug 1436659) for Eslint failures on devtools/server/actors/animation.js:876:12 on a CLOSED TREE
Backed out changeset a2890507d13a (bug 1436659)
Backed out changeset c653d7a1b3ef (bug 1436659)
Backed out changeset 4ae911f19aee (bug 1436659)
Backed out changeset e9381081ab6a (bug 1436659)
Backed out changeset 7301bfeeb65c (bug 1436659)
Backed out changeset 607dccfa8387 (bug 1436659)
Backed out changeset 8f61bf3de90a (bug 1436659)
Backed out changeset 920aa51ae3a2 (bug 1436659)
Backed out changeset bfa0d1a4bf1c (bug 1436659)
Backed out changeset 467dd218d3d3 (bug 1436659)
Backed out changeset 737ff1676ff0 (bug 1436659)
Backed out changeset 071666b6c7e9 (bug 1436659)
Backed out changeset c2932cd4839f (bug 1436659)
Backed out changeset a9777027b7ad (bug 1436659)

--HG--
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html => testing/web-platform/tests/web-animations/interfaces/Animation/playbackRate.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/the-current-time-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/current-time.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-animation-start-time.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-target-effect-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html
rename : testing/web-platform/tests/web-animations/timing-model/animations/setting-the-timeline-of-an-animation.html => testing/web-platform/tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html
2018-02-14 22:40:07 +02:00
Brian Birtles c8299638c0 Bug 1436659 - Implement pending playback rate mechanism; r=hiro
This reflects the following changes to the Web Animations specification:

  1. 5af5e276ba
  2. 673f6fc126

which can be viewed as a merged diff at:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: 3DoaWUkxBTo

--HG--
extra : rebase_source : a131054cc0d31a5db6b01ad288cf3b2cb0cc7016
2018-02-13 15:04:18 +09:00
Brian Birtles 70013cea9d Bug 1436659 - Add Animation::GetCurrentTimeForHoldTime helper; r=hiro
We will use this to calculate the unconstrained current time when we implement
pending playback rate changes.

MozReview-Commit-ID: 7GlmHiGeXF6

--HG--
extra : rebase_source : 82280cdd62c0426c114ce54bb92fcd7ed766d85a
2018-02-13 15:04:18 +09:00
Brian Birtles 37e9e76ea5 Bug 1436659 - Factor out static time calculation methods on Animation; r=hiro
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.

MozReview-Commit-ID: 2HV44TTNxHg

--HG--
extra : rebase_source : dcc883fb6db897a799900d709ca9c182dc149764
2018-02-13 15:04:18 +09:00
Brian Birtles 31272ef315 Bug 1436659 - Add Animation.updatePlaybackRate WebIDL definition; r=bz
This is the IDL added to the Web Animations specification:

  5af5e276ba

Note that some of the changes in the above commit were reverted in the following
commit:

  673f6fc126

A folded version of the changes:

  https://gist.github.com/birtles/d147eb2e0e2d4d37fadf217abd709411

MozReview-Commit-ID: CJV7bzizXg4

--HG--
extra : rebase_source : 6dc6819e158bcdd094962769096a17da6cd2026a
2018-02-13 15:04:18 +09:00
Hiroyuki Ikezoe 665b294c28 Bug 1237454 - Unthrottle transform animations in visibility:hidden element periodically only if the element is scrolled out. r=birtles
In the case where we throttle transform animations in visibility:hidden
element, we just need to unthrottle only if the element is scrolled out since
unlike the scrolled out element, visibility:hidden element keeps invisible
even after the element moved into view.

MozReview-Commit-ID: 7X2SsOLz4Y5

--HG--
extra : rebase_source : ca7210f7ed637f858127c4008fe98fbeec874a10
2018-02-09 19:00:19 +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
Tom Ritter 8184fa2b43 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : f3d8c1f9561fbb19d1ca8594ba2b69cffd25445b
2018-02-07 16:50:57 -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
Csoregi Natalia 7f21ecd2bf Backed out 4 changesets (bug 1435296) for for failing devtools' browser_webconsole_check_stubs_console_api.js and mochitest's dom/smil/test/test_smilTimeEvents.xhtml. CLOSED TREE
Backed out changeset 1f07c08daa41 (bug 1435296)
Backed out changeset 89c121b45b30 (bug 1435296)
Backed out changeset be9496eff7b8 (bug 1435296)
Backed out changeset 2f94f155318e (bug 1435296)
2018-02-09 17:20:53 +02:00
Tom Ritter b5eec93654 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : 5c1a3a1bb7cb10cd5c4a608f30bf097bd7e119b9
2018-02-07 16:50:57 -06:00
Hiroyuki Ikezoe fff9e9f366 Bug 1419339 - Unthrottle transform animations periodically if there is any IntersectionObservers. r=birtles
MozReview-Commit-ID: CBFQva02HUc

--HG--
extra : rebase_source : 123a26e7ab77ba40abd918e91e7f323300b2aae7
2018-02-07 10:46:15 +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