Bug 1471106 - Set overflow:hidden to body element to avoid accidentally unthrottling animations to update the overflow region. r?birtles
MozReview-Commit-ID: CtcgyUq37W5
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -41,16 +41,23 @@ SimpleTest.finish = function finish() {
to { transform: translate(0%, 0%); }
}
div {
/* Element needs geometry to be eligible for layerization */
width: 100px;
height: 100px;
background-color: white;
}
+body {
+ /*
+ * set overflow:hidden to avoid accidentally unthrottling animations to update
+ * the overflow region.
+ */
+ overflow: hidden;
+}
</style>
</head>
<body>
<script>
'use strict';
function getDocShellForObservingRestylesForWindow(aWindow) {
const docShell =
@@ -129,18 +136,16 @@ function waitForWheelEvent(aTarget) {
{ deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaY: targetRect.height },
resolve);
});
}
const omtaEnabled = isOMTAEnabled();
-const isAndroid = !!navigator.userAgent.includes("Android");
-
function add_task_if_omta_enabled(test) {
if (!omtaEnabled) {
info(test.name + " is skipped because OMTA is disabled");
return;
}
add_task(test);
}
@@ -1718,20 +1723,16 @@ waitForAllPaints(() => {
is(markers.length, 5,
'Visibility animation running on the main-thread on in-view element ' +
'should not be throttled');
await ensureElementRemoval(div);
});
add_task(async function restyling_outline_offset_animations_on_invisible_element() {
- if (isAndroid) {
- // FIXME: Bug 1470798: Enable this test on Android.
- return;
- }
const div = addDiv(null,
{ style: 'visibility: hidden; ' +
'outline-style: solid; ' +
'outline-width: 1px;' });
const animation =
div.animate({ outlineOffset: [ '0px', '10px' ] },
{ duration: 100 * MS_PER_SEC,
iterations: Infinity });
@@ -1742,20 +1743,16 @@ waitForAllPaints(() => {
is(markers.length, 0,
'Outline offset animation running on the main-thread on invisible ' +
'element should be throttled');
await ensureElementRemoval(div);
});
add_task(async function restyling_transform_animations_on_invisible_element() {
- if (isAndroid) {
- // FIXME: Bug 1470798: Enable this test on Android.
- return;
- }
const div = addDiv(null, { style: 'visibility: hidden;' });
const animation =
div.animate({ transform: [ 'none', 'rotate(360deg)' ] },
{ duration: 100 * MS_PER_SEC,
iterations: Infinity });
await waitForAnimationReadyToRestyle(animation);
@@ -1765,20 +1762,16 @@ waitForAllPaints(() => {
const markers = await observeStyling(5);
is(markers.length, 0,
'Transform animations on visibility hidden element should be throttled');
await ensureElementRemoval(div);
});
add_task(async function restyling_transform_animations_on_invisible_element() {
- if (isAndroid) {
- // FIXME: Bug 1470798: Enable this test on Android.
- return;
- }
const div = addDiv(null, { style: 'visibility: hidden;' });
const animation =
div.animate([ { transform: 'rotate(360deg)' } ],
{ duration: 100 * MS_PER_SEC,
iterations: Infinity });
await waitForAnimationReadyToRestyle(animation);
@@ -1790,20 +1783,16 @@ waitForAllPaints(() => {
is(markers.length, 0,
'Transform animations without 100% keyframe on visibility hidden ' +
'element should be throttled');
await ensureElementRemoval(div);
});
add_task(
async function restyling_transform_animations_having_abs_pos_child_on_invisible_element() {
- if (isAndroid) {
- // FIXME: Bug 1470798: Enable this test on Android.
- return;
- }
const div = addDiv(null, { style: 'visibility: hidden;' });
const child = addDiv(null, { style: 'position: absolute; top: 100px;' });
div.appendChild(child);
const animation =
div.animate({ transform: [ 'none', 'rotate(360deg)' ] },
{ duration: 100 * MS_PER_SEC,
iterations: Infinity });