Bug 419664 - Add support for prefers-reduced-motion
Summary: Add support for prefers-reduced-motion
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: 5.18.4
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Mikhail Zolotukhin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-05 08:52 UTC by momo
Modified: 2020-04-06 18:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description momo 2020-04-05 08:52:26 UTC
There is a CSS property called "prefers-reduced-motion" which reads its value from the system and tells websites to decrease the amount of animation (e.g. remove parallax scrolling) [1].

This flag could also potentially reduce motion over all the UI, decreasing transitions, movement and visual effects.

Firefox, recognises this on Windows, macOS and Gnome already (you need Gnome tweaks to set it). I think browsers could add support for KDE if we integrate this in our settings (maybe under Accesibility).


[1]: https://www.w3.org/WAI/WCAG21/Techniques/css/C39.html
Comment 1 David Edmundson 2020-04-05 16:22:57 UTC
Do you happen to know how browser's load this from gnome?
Comment 2 momo 2020-04-05 19:20:33 UTC
I have found this piece of code which I think is responsible for reading the value from Gnome/GTK in Firefox [1].

Unfortunately I couldn't find the same setting in Chromium but I'm sure someone more familiar with the codebase can.


[1]: https://dxr.mozilla.org/mozilla-central/source/widget/gtk/nsLookAndFeel.cpp#745
Comment 3 momo 2020-04-05 19:31:27 UTC
I have found the setting in Chromium[1].

If you go up through the call tree, it seems that they're checking this "gtk-enable-animations" variable to set a couple of other settings[2] (e.g. smooth scrolling [3]), as Gnome seems to lack a specific setting for reduced motion.

[1]: https://source.chromium.org/chromium/chromium/src/+/master:ui/gtk/gtk_ui.cc;l=719;bpv=0;bpt=1?originalUrl=https:%2F%2Fcs.chromium.org%2F
[2]: https://source.chromium.org/chromium/chromium/src/+/master:ui/gfx/animation/animation_linux.cc;l=17;drc=28442cacc3be1a7d05a898aba663025a143095ac;bpv=1;bpt=1?originalUrl=https:%2F%2Fcs.chromium.org%2F
[3]: https://askubuntu.com/questions/903160/turn-off-smooth-scrolling-in-gtk3
Comment 4 David Edmundson 2020-04-05 20:40:46 UTC
Ok, we can sync our animation slider to write out that setting.
Comment 5 Mikhail Zolotukhin 2020-04-06 18:50:08 UTC
gtk-enable-animations is already synced. See https://phabricator.kde.org/D26825