Problem/Motivation
As the batch API uses an animation and WCAG 2.1 introduces Success Criterion 2.2.9 Animation from Interactions (level AAA), it should be possible to disable the animation on the progress bar element.
Proposed resolution
Add a prefers-reduced-motion: reduce media query to disable the animation (i.e. respecting user prefs at the OS/browser level).
Movie demonstrating the appearance when reduced-motion is in effect: movie demo (quicktime movie, approx 1mb).
User interface changes
The animations will be disabled if requested by the user.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | interdiff-2940012-17-28.txt | 546 bytes | rachel_norfolk |
| #28 | plain_progress_bar-2940012-28.patch | 1.01 KB | rachel_norfolk |
| #21 | 4692DE94-0326-473A-8716-7FE548AFCF20.MOV | 1014.89 KB | rachel_norfolk |
| #14 | plain_progress_bar-2940012-14.patch | 1.19 KB | john cook |
| #13 | interdiff-2940012-2-13.txt | 524 bytes | john cook |
Comments
Comment #2
john cook commentedI've created a patch to update the css in Classy to use the media query.
Comment #3
john cook commentedComment #4
andrewmacpherson commentedThanks for working on this @johncook. This is a great first step which demonstrates how we can support platform level user prefs for reduced motion.
Some screenshots would be nice. How about an animated GIF showing the batch progress bar appearance when a reduced motion has been selected in macOS or iOS prefs?
Comment #5
rachel_norfolkI have run the patch in #2 on a new 8.6.x site and the animation on an iPad is indeed reduced as intended.
To configure an iOS iPad to reduce motion, I enabled the Settings > General > Accessibility > Redecue Motion setting. Then, I recorded adding a few hundred example Articles using the devel module to show the batch API progress meter. A short video (QuickTime .mov) is attached.
Would like to see the effect of this in Windows, especially on IE & Edge.
Comment #6
andrewmacpherson commentedSafari (macOS and iOS) is the only user agent which implements
prefers-reduced-motionto date, so that's no necessary.Comment #7
andrewmacpherson commentedThis is a great first step in the plan for #2928103: [policy, no patch] Use "prefers-reduced-motion" media query to disable animations.
Comment #8
mgiffordNice! Terrific to have a pattern we can start using with css animations.
Comment #9
andrewmacpherson commented@John Cook, can you elaborate on this comment about
transition: none? It would be good to know what the browser issues are with the CSS shorthand, and document them in the parent policy/plan. Currently Safari is the only browser which supports the media query, but when other browsers implement it, it would be good if we'd anticipated cross-browser support for animation properties.Still RTBC - this comment is just research to flesh out the parent policy/plan.
Comment #10
john cook commented@andrewmacpherson,
this is where I found the problem(?) with
transition:none: https://stackoverflow.com/questions/6634470/disable-turn-off-inherited-c...The issue only appear to only effect Oprea browsers. Would using
-o-transition: all 0 none; transition: none;be prefered?Comment #11
andrewmacpherson commentedThanks! I don't have an opinion on which is preferred; perhaps the CSS maintainers and/or front-end framework managers do. I just want it noted as a possible WTF on the parent plan. I use that stackoverflow link.
Comment #12
alexpottWe need to update our stylelint rules for this change.
We need to add the following to the patch:
I think the suggestion in #10 is neater but yeah a frontend framework manager should comment as this is a new thing.
Comment #13
john cook commentedI've created a new patch incorporating @alexpott's linting suggestion from #12.
Comment #14
john cook commentedI've created a patch that uses the
transition: none;method from #10, hopefully making it easier for the frontend framework manager to choose.The
-webkit-...variant is left because it has been specifically set in the.progress__barselector preceding this addition.Comment #15
john cook commentedComment #16
john cook commentedI've updated the comment as pointed out by Brian Teeman.
Comment #18
andrewmacpherson commented@John Cook - can you explain what the changes in #16 are about? I read the linked Joomla GitHub issue, and I'm not sure what part of it you're referring to. Why is it preferable to use the shorthand instead of tranition-duration?
Comment #19
abhisekmazumdarRe-roll of #16 patch.
Comment #20
john cook commented@andrewmacpherson, the patch in #16 was just to make the comment more specific — stating that it was a problem with Opera instead of "some bowsers".
I think it was changed to the shorthand version just to have cleaner code. This was done in #10.
Comment #21
rachel_norfolkJust manually re-tested on my iPad with prefers-reduced-motion enabled. All is still working as expected and the comments from Alexpott have been incorporated.
Screen recording attached.
Setting to RTBC...
Comment #22
andrewmacpherson commentedI did some more manual testing of this, to check that these rules would disbable animation in all browsers. I wanted to confirm that we were future-proofed for when other browsers eventually support it, mainly the Opera quirk that's been noted. So I tested with the media query wrapper lines commented out, i.e. like this:
All the browsers we support display the non-animated style correctly.
+1 to RTBC, this is a great first-step to supporting prefers-reduced-motion across all our UI.
The framework manager review tag is still here, for the new linting rules I think.
Comment #23
andrewmacpherson commentedAdding the visually-induced motion sickness tag. I know @mgifford is using this tag, and linking to it in upstream browser bugtrackers..
Comment #25
MixologicTestbot Snafu.
Comment #26
rachel_norfolkJust wanted to record here that the initial work on this took place at the sprint in Leeds alongside Brian Teeman from Joomla!
He also raised the equivalent issue in their queues.
Joomla issue
https://github.com/joomla/joomla-cms/issues/19694
Pushed up to Bootstrap (as that’s their admin theme)
https://github.com/twbs/bootstrap/issues/25249
Solved by Bootstrap
https://github.com/twbs/bootstrap/pull/25641
Comment #27
lauriiiThis is only a problem with some very old versions of Opera that aren't supported, and doesn't support
prefers-reduced-motion. Since they are not supported anymore, they won't get support for that feature in future so no reason to try to support them meaning that we could remove this.Comment #28
rachel_norfolkThat’s good - I like not having loads of “exceptions” in there!
(Another patch done on the iPad...)
Comment #29
andrewmacpherson commentedPatch #28 is straightforward, addresses #27.
Comment #30
mgiffordIs this our first VIMS patch that's gotten to RTBC?
Comment #32
lauriiiThis seems like a low risk change for Classy. Anyway, because this is modifying code that people are relying on production, I'm only committing this to the development branch.
Committed 427ffa6 and pushed to 8.6.x. Thanks!
Comment #33
andrewmacpherson commented@mgifford - yes, this is the first. There aren't many animations in core yet, and this one looked like a good starter to see how we would manage it. Next up is #2940677: Support prefers-reduced-motion in off-canvas dialog which involves a big portion of the viewport.
Comment #34
andrewmacpherson commentedIncluding the video demo in the issue summary. I'll use this issue as a demo/reference for other stuff in future.
Comment #36
lauriiiComment #37
andrewmacpherson commentedThe
prefers-reduced-motionmedia query will be supported in Firefox 63 for Windows (the Mac version will arrive later). I've tested the progress bar with the latest Firefox Nightly on Windows 7 and 10, and this is working there as expected.The media query is tied to the OS-level user setting.