Bug 1690476 - Deal with backwards compat for simulation features. r=jdescottes
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 10 Feb 2021 15:35:18 +0000
changeset 566831 ffd5979ffbd642edf036d1826c698f403c155535
parent 566830 a65883accdf6e90fae4fe5e85ab43e950e50f649
child 566832 2443341cb2526439e5708b7d8443f714115602b0
push id38191
push userbtara@mozilla.com
push dateThu, 11 Feb 2021 05:02:45 +0000
treeherdermozilla-central@5cbcb80f72bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1690476
milestone87.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1690476 - Deal with backwards compat for simulation features. r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D104376
devtools/client/inspector/rules/rules.js
devtools/server/actors/targets/browsing-context.js
--- a/devtools/client/inspector/rules/rules.js
+++ b/devtools/client/inspector/rules/rules.js
@@ -502,16 +502,22 @@ CssRuleView.prototype = {
     }
   },
 
   /**
    * Initializes the content-viewer front and enable the print and color scheme simulation
    * if they are supported in the current target.
    */
   async _initSimulationFeatures() {
+    // @backward-compat { version 87 } Print & color scheme simulations should
+    // now be set using reconfigure.
+    if (!this.currentTarget.getTrait("reconfigureSupportsSimulationFeatures")) {
+      return;
+    }
+
     if (!this.currentTarget.chrome) {
       this.printSimulationButton.removeAttribute("hidden");
       this.printSimulationButton.addEventListener(
         "click",
         this._onTogglePrintSimulation
       );
     }
 
--- a/devtools/server/actors/targets/browsing-context.js
+++ b/devtools/server/actors/targets/browsing-context.js
@@ -534,16 +534,19 @@ const browsingContextTargetPrototype = {
 
     const response = {
       actor: this.actorID,
       browsingContextID: this.browsingContextID,
       traits: {
         // @backward-compat { version 64 } Exposes a new trait to help identify
         // BrowsingContextActor's inherited actors from the client side.
         isBrowsingContext: true,
+        // @backward-compat { version 87 } Print & color scheme simulations
+        // should now be set using reconfigure.
+        reconfigureSupportsSimulationFeatures: true,
       },
     };
 
     // We may try to access window while the document is closing, then accessing window
     // throws.
     if (!this.docShell.isBeingDestroyed()) {
       response.title = this.title;
       response.url = this.url;