Closed
Bug 1479239
Opened 7 years ago
Closed 7 years ago
prefers-reduced-motion should be sensible with unsupported platforms / resistFingerprinting.
Categories
(Core :: CSS Parsing and Computation, enhancement)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(1 file)
With the current early-returning behavior, the expression will unconditionally
evaluate to false, which is a bit of a footgun.
| Assignee | ||
Comment 1•7 years ago
|
||
With the current early-returning behavior, the expression will unconditionally
evaluate to false, which is a bit of a footgun.
Make sure to always return no-preference in unsupported platforms or when
resisting fingerprinting.
Comment 2•7 years ago
|
||
Oh thanks. The test case is really easy to understand what the problem is, Emilio is mentioning.
But hmm, it seems to me the expected background-color is 'red'.
Tom, what should we do when the resistFingerprinting pref is set? We should do 'no-preference' or do as if we don't support prefers-reduced-motion at all? It doen't expose any system settings, so it's not a big deal though.
Flags: needinfo?(tom)
| Assignee | ||
Comment 3•7 years ago
|
||
How would the expected background color be red? That trivially exposes whether the resist-fingerprinting pref is enabled, which looks like an anti-goal to me :)
Comment 4•7 years ago
|
||
Oh right, indeed. It looks the pref is exposed actually. :) Then the change makes totally sense to me.
Tom, sorry for the noise. :)
Flags: needinfo?(tom)
Comment 5•7 years ago
|
||
Comment on attachment 8995763 [details]
Bug 1479239: prefers-reduced-motion should be sensible re. unsupported platforms / resistFingerprinting. r=hiro
Hiroyuki Ikezoe (:hiro) has approved the revision.
https://phabricator.services.mozilla.com/D2491
Attachment #8995763 -
Flags: review+
| Assignee | ||
Comment 6•7 years ago
|
||
Note that pages right now can detect whether resist-fingerprinting is enabled via a similar offender (GetSystemMetric), with something like:
let mediaList = matchMedia("(-moz-touch-enabled)");
let parsed = mediaList.media != "not all";
let resistFingerprintingEnabled =
parsed && !mediaList.matches && !matchMedia("(-moz-touch-enabled: 0)").matches;
I'm fixing that in bug 1479240.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b1e7eb636989
prefers-reduced-motion should be sensible re. unsupported platforms / resistFingerprinting. r=hiro
Comment 8•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment 9•7 years ago
|
||
This is probably a separate bug, but looking at this demo:
https://webkit.org/blog-files/prefers-reduced-motion/prm.htm
The last example has:
var motionQuery2 = matchMedia('(prefers-reduced-motion: no-preference)');
function handleReduceMotionChanged2() {
document.images['jaws'].src = motionQuery2.matches ? 'jaws.gif' : 'jaws.jpg';
}
handleReduceMotionChanged2(); // trigger this once on load to set up the initial value
motionQuery.addListener(handleReduceMotionChanged2); // Note: https://webkit.org/b/168491
And the test case text has:
Example 4: Only display animated version if prefers-reduced-motion is both supported *and* off.
This example uses a more explicit match for (prefers-reduced-motion: no-preference) which excludes all browsers that don't yet support the new feature.
For platforms where we don't support prefers-reduced-motion, should we still match prefers-reduced-motion: no-preference ?
On Linux I see the animated graphic although we don't meaningfully support prefers-reduced-motion there.
Comment 10•7 years ago
|
||
That's a trick of our ui.prefersReducedMotion preference. On Linux we don't tie prefers-reduced-motion to the system setting yet (just landed on autoland though in bug 1478519), but we can set the preference value on Linux, and the preference value is 'no-preference' by default.
Comment 11•7 years ago
|
||
Oh I see. I didn't realize there was a pref for it. I thought it wasn't supported at all on Linux.
You need to log in
before you can comment on or make changes to this bug.
Description
•