Bug 1319950 - DPR watching should move to actor. r=me draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 09 Jan 2017 18:47:38 -0600
changeset 464547 e46bbb1fb90de406f6f5320e8e24d35db1c0a4e1
parent 464546 3918b9d24f734ec0d891d266cddcac326c9a675d
child 464548 362033f66891a72e6229a96ecfbf9cf908438446
child 465687 8b04f5f3b524a1891e82b2cc20a46ece36081c7b
push id42365
push userbmo:jryans@gmail.com
push dateSat, 21 Jan 2017 00:40:38 +0000
reviewersme
bugs1319950
milestone53.0a1
Bug 1319950 - DPR watching should move to actor. r=me MozReview-Commit-ID: KcPhlh5uYJO
devtools/client/responsive.html/index.js
--- a/devtools/client/responsive.html/index.js
+++ b/devtools/client/responsive.html/index.js
@@ -94,16 +94,19 @@ window.dispatch = action => bootstrap.di
 Object.defineProperty(window, "store", {
   get: () => bootstrap.store,
   enumerable: true,
 });
 
 // Dispatch a `changeDisplayPixelRatio` action when the browser's pixel ratio is changing.
 // This is usually triggered when the user changes the monitor resolution, or when the
 // browser's window is dragged to a different display with a different pixel ratio.
+// TODO: It would be better to move this watching into the actor, so that it can be
+// better synchronized with any overrides that might be applied.  Also, reading a single
+// value like this makes less sense with multiple viewports.
 function onDPRChange() {
   let dpr = window.devicePixelRatio;
   let mql = window.matchMedia(`(resolution: ${dpr}dppx)`);
 
   function listener() {
     bootstrap.dispatch(changeDisplayPixelRatio(window.devicePixelRatio));
     mql.removeListener(listener);
     onDPRChange();