From 23bde393c259f5b8c1c93581234988853de1eb12 Mon Sep 17 00:00:00 2001 From: EnderDev Date: Mon, 1 Jan 2024 19:50:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Respect=20reduced=20motion=20pre?= =?UTF-8?q?ference=20for=20tab=20animations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tabs/content/browser-tab.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/components/tabs/content/browser-tab.js b/components/tabs/content/browser-tab.js index e170047a9b..0d42e28ad6 100644 --- a/components/tabs/content/browser-tab.js +++ b/components/tabs/content/browser-tab.js @@ -316,20 +316,24 @@ class BrowserRenderedTab extends BrowserCustomizableArea { * Determines how long to animate the tab for on open */ get _tabInAnimateDuration() { - return Services.prefs.getIntPref( - "dot.tabs.in_animation_duration_ms", - 50 - ); + return gDot.prefersReducedMotion + ? 0 + : Services.prefs.getIntPref( + "dot.tabs.in_animation_duration_ms", + 50 + ); } /** * Determines how long to animate the tab for on close */ get _tabOutAnimateDuration() { - return Services.prefs.getIntPref( - "dot.tabs.out_animation_duration_ms", - 30 - ); + return gDot.prefersReducedMotion + ? 0 + : Services.prefs.getIntPref( + "dot.tabs.out_animation_duration_ms", + 30 + ); } get animationProps() {