diff --git a/dom/animation/test/mozilla/file_restyles.html b/dom/animation/test/mozilla/file_restyles.html index 2b56c1eacb1f..c881149a431e 100644 --- a/dom/animation/test/mozilla/file_restyles.html +++ b/dom/animation/test/mozilla/file_restyles.html @@ -1756,6 +1756,28 @@ waitForAllPaints(() => { await ensureElementRemoval(div); }); + add_task(async function restyling_transform_aimations_on_invisible_element() { + if (isAndroid) { + // FIXME: Bug 1470798: Enable this test on Android. + return; + } + // 'opacity: 0' prevents transform animations to be sent to the compositor. + const div = addDiv(null, { style: 'visibility: hidden; opacity: 0' }); + + const animation = + div.animate({ transform: [ 'none', 'rotate(360deg)' ] }, + { duration: 100 * MS_PER_SEC, + iterations: Infinity }); + + await waitForAnimationReadyToRestyle(animation); + + const markers = await observeStyling(5); + + is(markers.length, 0, + 'Transform animations on visibility hidden element should be throttled'); + await ensureElementRemoval(div); + }); + }); diff --git a/layout/base/nsChangeHint.h b/layout/base/nsChangeHint.h index 959240a0e72f..d14b112a35f6 100644 --- a/layout/base/nsChangeHint.h +++ b/layout/base/nsChangeHint.h @@ -461,6 +461,7 @@ static_assert(!(nsChangeHint_Hints_AlwaysHandledForDescendants & nsChangeHint_NeutralChange | \ nsChangeHint_UpdateOpacityLayer | \ nsChangeHint_AddOrRemoveTransform | \ + nsChangeHint_UpdateContainingBlock | \ nsChangeHint_UpdateOverflow | \ nsChangeHint_UpdatePostTransformOverflow | \ nsChangeHint_UpdateTransformLayer | \