зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1642323 - Make alert.js obey prefers-reduced-motion. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D78032
This commit is contained in:
Родитель
7875f1e34e
Коммит
56cbbca35b
|
@ -1,3 +1,9 @@
|
|||
// Platforms may default to reducing motion. We override this to ensure the
|
||||
// alert slide animation is enabled in tests.
|
||||
SpecialPowers.pushPrefEnv({
|
||||
set: [["ui.prefersReducedMotion", 0]],
|
||||
});
|
||||
|
||||
async function addNotificationPermission(originString) {
|
||||
return SpecialPowers.pushPermissions([
|
||||
{
|
||||
|
|
|
@ -211,9 +211,7 @@ function onAlertLoad() {
|
|||
|
||||
// If the require interaction flag is set, prevent auto-closing the notification.
|
||||
if (!gRequireInteraction) {
|
||||
if (
|
||||
!Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled", true)
|
||||
) {
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
||||
setTimeout(function() {
|
||||
window.close();
|
||||
}, ALERT_DURATION_IMMEDIATE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче