ACTION-76: Review Mats Palmgren's Mozilla MQ preference exposure feature
Review Mats Palmgren's Mozilla MQ preference exposure feature
- State:
- closed
- Person:
- James Craig
- Due on:
- November 28, 2013
- Created on:
- November 21, 2013
- Associated Product:
- IndieUI: User Context 1.0
- Related emails:
- No related emails
Related notes:
From Mats:
The work was done in Mozilla bug 677302
and my proposal was to use a media expression, for example:
@media print and (-moz-preference "print.print_color" : true) {
...
}
see comment 8 for details:
https://bugzilla.mozilla.org/show_bug.cgi?id=677302#c8
An alternative was to use an @-rule like so:
'@-moz-preference' '(' <pref-name> ',' <pref-value> ')' '{' <rule>* '}'
see https://bugzilla.mozilla.org/show_bug.cgi?id=677302#c3
My response:
Yes. I sent it to the www-style and web-apps list, but got some feedback that only portions of it should be MQs, so the rest will end up being a JavaScript interface unrelated to matchMedia.
I would recommend waiting a few weeks to review the ED, because I’m going to try to incorporate all the TPAC feedback soon. However, if you’re really curious, here are some links.
Newer media-query approach…
https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-context.html
But ED updates will also reintroduce the JS API from the previous drafts…
https://dvcs.w3.org/hg/IndieUI/raw-file/6644d04a01df/src/indie-ui-context.html#UserSettings
So your example could use “moz” in the optional taxonomy param, and do something like this:
var printColor = navigator.settings.valueForKey("print.print_color", "moz”);
And potentially something like this:
@media print and (user-color-luminosity > 40%) { … }
See the www-style thread between Tab and me, starting here.
http://lists.w3.org/Archives/Public/www-style/2013Nov/0182.html
By thread:
http://lists.w3.org/Archives/Public/www-style/2013Nov/thread.html#msg182
Reviewed and replied.
https://bugzilla.mozilla.org/show_bug.cgi?id=677302#c27
Display change log.