Bug 1357774 - Part 1: Add a 'SetCurrentRDMPaneOrientation' WebIDL extension on the Document r=bradwerth,smaug
☠☠ backed out by 9c251c872a33 ☠ ☠
authorMicah Tigley <mtigley@mozilla.com>
Tue, 14 May 2019 23:42:30 +0000
changeset 473876 90ff166702b5dd7e9848eef62746457b11d8fe92
parent 473875 a2fe99cb693af42947db157c030ac85c47002c0d
child 473877 9d42cbab5277796bf76e874bdc4fe3eaaad99889
push id36017
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 09:25:56 +0000
treeherdermozilla-central@76bbedc1ec1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbradwerth, smaug
bugs1357774
milestone68.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 1357774 - Part 1: Add a 'SetCurrentRDMPaneOrientation' WebIDL extension on the Document r=bradwerth,smaug Differential Revision: https://phabricator.services.mozilla.com/D29455
dom/base/Document.h
dom/webidl/Document.webidl
hal/sandbox/SandboxHal.cpp
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -1970,16 +1970,22 @@ class Document : public nsINode,
   OrientationType CurrentOrientationType() const {
     return mCurrentOrientationType;
   }
   void SetOrientationPendingPromise(Promise* aPromise);
   Promise* GetOrientationPendingPromise() const {
     return mOrientationPendingPromise;
   }
 
+  void SetRDMPaneOrientation(OrientationType aType, uint16_t aAngle) {
+    if (mInRDMPane) {
+      SetCurrentOrientation(aType, aAngle);
+    }
+  }
+
   //----------------------------------------------------------------------
 
   // Document notification API's
 
   /**
    * Add a new observer of document change notifications. Whenever
    * content is changed, appended, inserted or removed the observers are
    * informed.  An observer that is already observing the document must
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -579,9 +579,13 @@ partial interface Document {
 /**
  * Document extensions to support devtools.
  */
 partial interface Document {
   // Is the Document embedded in a Responsive Design Mode pane. This property
   // is not propegated to descendant Documents upon settting.
   [ChromeOnly]
   attribute boolean inRDMPane;
+  // Extension to give chrome JS the ability to set the window screen
+  // orientation while in RDM.
+  [ChromeOnly]
+  void setRDMPaneOrientation(OrientationType type, float rotationAngle);
 };
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -80,17 +80,17 @@ void EnableScreenConfigurationNotificati
 void DisableScreenConfigurationNotifications() {
   Hal()->SendDisableScreenConfigurationNotifications();
 }
 
 void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
   fallback::GetCurrentScreenConfiguration(aScreenConfiguration);
 }
 
-bool LockScreenOrientation(const ScreenOrientation& aOrientation) {
+bool LockScreenOrientation(const hal::ScreenOrientation& aOrientation) {
   bool allowed;
   Hal()->SendLockScreenOrientation(aOrientation, &allowed);
   return allowed;
 }
 
 void UnlockScreenOrientation() {
   // Don't send this message from both the middleman and recording processes.
   if (!recordreplay::IsMiddleman()) {