58 lines
2.4 KiB
Diff
58 lines
2.4 KiB
Diff
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 | 3 +++
|
|
3 files changed, 5 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,8 @@ bool Animation::ScrollAnimationsEnabledBySystem() {
|
|
|
|
// static
|
|
void Animation::UpdatePrefersReducedMotion() {
|
|
+ prefers_reduced_motion_ = false;
|
|
+ if ((true)) return;
|
|
// prefers_reduced_motion_ should only be modified on the UI thread.
|
|
// TODO(crbug.com/40611878): DCHECK this assertion once tests are
|
|
// well-behaved.
|
|
--
|