Closed Bug 1475462 Opened 6 years ago Closed 6 years ago

Add support for CSS prefers-reduced-motion media feature for MacOSX

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

x86_64
macOS
enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

(Blocks 1 open bug)

Details

(Keywords: access, dev-doc-complete, DevAdvocacy, Whiteboard: [devRel:P1][FFI?])

Attachments

(3 files)

This is for prefers-reduced-motion media feature on MacOSX.

+++ This bug was initially created as a clone of Bug #1365045 +++

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4




Expected results:

Add support for CSS prefers-reduced-motion media feature.

New in CSS Media Queries Level 5:
https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion

WebKit blog post covering the feature, justification, and examples:
https://webkit.org/blog/7551/responsive-design-for-motion/
Depends on: mojave-sdk
No longer depends on: 1365045
Depends on: 1365045
Attached patch A patch for thisSplinter Review
This patch should work, but this patch needs SDK 10.12 or higher, so to build MacOSX binary with this patch we need to update the SDK on our build infrastructures (bug 1475652)
Blocks: 1417776
(In reply to Hiroyuki Ikezoe (:hiro) from comment #1)
> Created attachment 8992523 [details] [diff] [review]
> A patch for this
> 
> This patch should work, but this patch needs SDK 10.12 or higher, so to
> build MacOSX binary with this patch we need to update the SDK on our build
> infrastructures (bug 1475652)

If we want to move forward here while waiting for an infrastructure SDK update, it should work to just include a local declaration of the accessibilityDisplayShouldReduceMotion property in the source file. See https://treeherder.mozilla.org/#/jobs?repo=try&revision=031a85b40d3c14f703b6396ac075fa682594d250 for a try job where I pushed your patch with an added declaration.
That's great info!  Thanks Jonathan!   I've been trying to cross compile on Linux locally, and did just today succeed it with SDK 10.11 which is the one we currently use.  So anyway, it would be nice that someone tries the binary in the Jonathan's try in comment 2 and sees whether it works really fine on MacOSX devices.  I don't have any MacOS environment unfortunately.
I tried this build on macOS 10.13 (with the demo at https://webkit.org/blog-files/prefers-reduced-motion/prm.htm), and it works as expected -- mostly.

The one shortcoming is that it doesn't respond to toggling the reduced-motion preference on the fly (as Safari does); even reloading the page (in the same tab) doesn't cause it to respect the new setting. Loading the same page into a new tab, however, does pick up the changed setting.
I guess this means we should listen for the NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification notification, and do.... something, I'm not sure exactly what.... to refresh things when it is received.
(In reply to Jonathan Kew (:jfkthame) from comment #4)
> I tried this build on macOS 10.13 (with the demo at
> https://webkit.org/blog-files/prefers-reduced-motion/prm.htm), and it works
> as expected -- mostly.
> 
> The one shortcoming is that it doesn't respond to toggling the
> reduced-motion preference on the fly (as Safari does); even reloading the
> page (in the same tab) doesn't cause it to respect the new setting. Loading
> the same page into a new tab, however, does pick up the changed setting.

Thank you Jonathan!  That's exactly expected behavior!  Style changes responding to the system setting has't implemented yet, I was going to do it in a later bug, but anyway, here is a patch for that.
The local declaration part was done by jfkthame.
Comment on attachment 9004724 [details]
Bug 1475462 - Implement prefers-reduced-motion for MacOSX. r=mstange

Markus Stange [:mstange] has approved the revision.
Attachment #9004724 - Flags: review+
Blocks: 1486971
Assignee: nobody → hikezoe
Status: NEW → ASSIGNED
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c635c42c13c
Implement prefers-reduced-motion for MacOSX. r=mstange
https://hg.mozilla.org/mozilla-central/rev/0c635c42c13c
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Dropping the dependency to upgrade SDK (thanks to Jonathan Kew).
No longer depends on: mojave-sdk
Blocks: 1492284
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: