Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ea6c4fa5 authored by Carmelo Messina's avatar Carmelo Messina
Browse files

Disable prefers reduced motion: Disables the possibility of retrieving the...

Disable prefers reduced motion: Disables the possibility of retrieving the device user setting via css prefers-reduced-motion (#2032)
parent 2bf7dd4f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -299,6 +299,7 @@ Android-fonts-fingerprinting-mitigation.patch
Disable-Android-Tab-Declutter.patch
Disable-CSSDynamicRangeLimit.patch
Android-Import-Passwords.patch
Disable-prefers-reduced-motion.patch

# temporary or wip patches
Temp-PerformanceNavigationTiming-privacy-fix.patch
+56 −0
Original line number Diff line number Diff line
From: uazo <uazo@users.noreply.github.com>
Date: Fri, 30 May 2025 10:29:39 +0000
Subject: Disable prefers reduced motion

Disables the possibility of retrieving the device user setting via
css prefers-reduced-motion

License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
 ui/android/java/src/org/chromium/ui/gfx/Animation.java | 1 +
 ui/gfx/animation/animation_linux.cc                    | 1 +
 ui/gfx/animation/animation_win.cc                      | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/ui/android/java/src/org/chromium/ui/gfx/Animation.java b/ui/android/java/src/org/chromium/ui/gfx/Animation.java
--- a/ui/android/java/src/org/chromium/ui/gfx/Animation.java
+++ b/ui/android/java/src/org/chromium/ui/gfx/Animation.java
@@ -21,6 +21,7 @@ import org.chromium.build.annotations.NullMarked;
 public class Animation {
     @CalledByNative
     private static boolean prefersReducedMotion() {
+        if ((true)) return false;
         // We default to assuming that animations are enabled, to avoid impacting the experience for
         // users that don't have ANIMATOR_DURATION_SCALE defined.
         final float defaultScale = 1f;
diff --git a/ui/gfx/animation/animation_linux.cc b/ui/gfx/animation/animation_linux.cc
--- a/ui/gfx/animation/animation_linux.cc
+++ b/ui/gfx/animation/animation_linux.cc
@@ -13,6 +13,7 @@ namespace {
 // Linux toolkits only have a global setting for whether animations should be
 // enabled.  So use it for all of the specific settings that Chrome needs.
 bool AnimationsEnabled() {
+  if ((true)) return true;
   auto* linux_ui = ui::LinuxUi::instance();
   return !linux_ui || linux_ui->AnimationsEnabled();
 }
diff --git a/ui/gfx/animation/animation_win.cc b/ui/gfx/animation/animation_win.cc
--- a/ui/gfx/animation/animation_win.cc
+++ b/ui/gfx/animation/animation_win.cc
@@ -12,6 +12,7 @@ namespace gfx {
 
 // static
 bool Animation::ShouldRenderRichAnimationImpl() {
+  if ((true)) return true;
   BOOL result;
   // Get "Turn off all unnecessary animations" value.
   if (::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)) {
@@ -27,6 +28,7 @@ bool Animation::ScrollAnimationsEnabledBySystem() {
 
 // static
 void Animation::UpdatePrefersReducedMotion() {
+  if ((true)) return false;
   // prefers_reduced_motion_ should only be modified on the UI thread.
   // TODO(crbug.com/40611878): DCHECK this assertion once tests are
   // well-behaved.
--