Bug 1593708 - Part 4: Update RDM to set inRDMPane property on the BrowsingContext. r=bradwerth
authorMicah Tigley <mtigley@mozilla.com>
Thu, 07 Nov 2019 22:17:18 +0000
changeset 502466 32913780ebb3fae5fce3499e90692332cde39578
parent 502465 33d4fb0808c9f786038a318eb87ddcec3e69b97c
child 502467 975df36124a5bc2fbaf43c9ec0bdc3b93048d49c
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbradwerth
bugs1593708
milestone72.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 1593708 - Part 4: Update RDM to set inRDMPane property on the BrowsingContext. r=bradwerth Depends on D52217 Differential Revision: https://phabricator.services.mozilla.com/D52219
devtools/client/responsive/browser/content.js
devtools/client/responsive/test/browser/browser_in_rdm_pane.js
devtools/server/actors/emulation.js
--- a/devtools/client/responsive/browser/content.js
+++ b/devtools/client/responsive/browser/content.js
@@ -213,17 +213,17 @@ var global = this;
     docShell.contentViewer.DOMDocument.setRDMPaneOrientation(
       "landscape-primary",
       0
     );
   }
 
   function setDocumentInRDMPane(inRDMPane) {
     // We don't propegate this property to descendent documents.
-    docShell.contentViewer.DOMDocument.inRDMPane = inRDMPane;
+    docShell.browsingContext.inRDMPane = inRDMPane;
   }
 
   function flushStyle() {
     // Force presContext destruction
     const isSticky = docShell.contentViewer.sticky;
     docShell.contentViewer.sticky = false;
     docShell.contentViewer.hide();
     docShell.contentViewer.show();
@@ -257,17 +257,16 @@ var global = this;
     );
   }
 
   const WebProgressListener = {
     onLocationChange(webProgress, request, URI, flags) {
       if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
         return;
       }
-      setDocumentInRDMPane(true);
       // Notify the Responsive UI manager to set orientation state on a location change.
       // This is necessary since we want to ensure that the RDM Document's orientation
       // state persists throughout while RDM is opened.
       sendAsyncMessage("ResponsiveMode:OnLocationChange", {
         width: content.innerWidth,
         height: content.innerHeight,
       });
       makeScrollbarsFloating();
--- a/devtools/client/responsive/test/browser/browser_in_rdm_pane.js
+++ b/devtools/client/responsive/test/browser/browser_in_rdm_pane.js
@@ -12,17 +12,17 @@ addRDMTask(
   TEST_URL,
   async function({ browser }) {
     const contentURL = await ContentTask.spawn(browser, {}, function() {
       return content.document.URL;
     });
     info("content URL is " + contentURL);
 
     const contentInRDMPane = await ContentTask.spawn(browser, {}, function() {
-      return content.document.inRDMPane;
+      return content.docShell.browsingContext.inRDMPane;
     });
 
     ok(
       contentInRDMPane,
       "After RDM is opened, document should have inRDMPane set to true."
     );
   },
   true
--- a/devtools/server/actors/emulation.js
+++ b/devtools/server/actors/emulation.js
@@ -458,14 +458,14 @@ const EmulationActor = protocol.ActorCla
   },
 
   async captureScreenshot() {
     return this.screenshotActor.capture({});
   },
 
   async setDocumentInRDMPane(inRDMPane) {
     if (this.docShell && this.docShell.document) {
-      this.docShell.document.inRDMPane = inRDMPane;
+      this.docShell.browsingContext.inRDMPane = inRDMPane;
     }
   },
 });
 
 exports.EmulationActor = EmulationActor;