bug 1300784 draft
authormiguel <wrigh517@msu.edu>
Sat, 01 Oct 2016 16:28:23 -0400
changeset 858115 aec6046af2696e651f00616071772b77ba5fae9f
parent 857951 344920af45b92da6d4f5b84738e1c7a3fb582461
child 858116 07a46bf3b3f379dff2687ffa594546bb4f799dc5
child 858119 a8d44a7aa84b316c6aff3ac267a431c3f7a607a0
child 865154 c0e881d3b8fb041281f6ff9ef773e5f8acf0cb9e
push id147523
push userwrigh517@msu.edu
push dateSun, 02 Oct 2016 15:27:04 +0000
treeherdertry@07a46bf3b3f3 [default view] [failures only]
bugs1300784
milestone52.0a1
bug 1300784 MozReview-Commit-ID: GMBsqDnwxZz
.lldbinit
layout/forms/nsListControlFrame.cpp
toolkit/content/widgets/browser.xml
toolkit/content/widgets/remote-browser.xml
--- a/.lldbinit
+++ b/.lldbinit
@@ -24,8 +24,15 @@ settings set target.prefer-dynamic-value
 # Show the string value in atoms.
 type summary add nsIAtom --summary-string "${var.mString}"
 
 # Show the value of text nodes.
 type summary add nsTextNode --summary-string "${var.mText}"
 
 # Dump the current JS stack.
 command alias js expr DumpJSStack()
+# Import Mozilla settings and utilities (the awkward structure of these
+# commands is necessary to avoid double importing of the Mozilla .lldbinit):
+
+script fallbacktopsrcdir = "/Users/mwright/capstone/firefox_artifact"
+script istopsrcdir = os.path.exists("mozilla-config.h.in")
+script topsrcdir = os.getcwd() if istopsrcdir else fallbacktopsrcdir
+script ignored = istopsrcdir or lldb.debugger.HandleCommand("command source -s true " + os.path.join(topsrcdir, ".lldbinit"))
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -136,18 +136,17 @@ nsListControlFrame::DestroyFrom(nsIFrame
                                       mEventListener, false);
   mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"),
                                       mEventListener, false);
   mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mouseup"),
                                       mEventListener, false);
   mContent->RemoveSystemEventListener(NS_LITERAL_STRING("mousemove"),
                                       mEventListener, false);
 
-  if (XRE_IsContentProcess() &&
-      Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
+  if (Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
     nsContentUtils::AddScriptRunner(
       new AsyncEventDispatcher(mContent,
                                NS_LITERAL_STRING("mozhidedropdown"), true,
                                true));
   }
 
   nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), false);
   nsHTMLScrollFrame::DestroyFrom(aDestructRoot);
@@ -1774,18 +1773,17 @@ nsListControlFrame::GetIndexFromDOMEvent
   }
 
   return NS_ERROR_FAILURE;
 }
 
 static bool
 FireShowDropDownEvent(nsIContent* aContent, bool show)
 {
-  if (XRE_IsContentProcess() &&
-      Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
+  if (Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
     nsContentUtils::DispatchChromeEvent(aContent->OwnerDoc(), aContent,
                                         show ? NS_LITERAL_STRING("mozshowdropdown") :
                                                NS_LITERAL_STRING("mozhidedropdown"),
                                         true, false);
     return true;
   }
 
   return false;
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -913,16 +913,23 @@
           }
 
           if (this.messageManager) {
             this.messageManager.addMessageListener("PopupBlocking:UpdateBlockedPopups", this);
             this.messageManager.addMessageListener("Autoscroll:Start", this);
             this.messageManager.addMessageListener("Autoscroll:Cancel", this);
             this.messageManager.addMessageListener("AudioPlayback:Start", this);
             this.messageManager.addMessageListener("AudioPlayback:Stop", this);
+
+            if (this.hasAttribute("selectmenulist")) {
+              this.messageManager.addMessageListener("Forms:ShowDropDown", this);
+              this.messageManager.addMessageListener("Forms:HideDropDown", this);
+              this.messageManager.loadFrameScript("chrome://global/content/select-child.js", true);
+            }
+
           }
         ]]>
       </constructor>
 
       <destructor>
         <![CDATA[
           this.destroy();
         ]]>
@@ -999,21 +1006,45 @@
               this._autoScrollPopup.hidePopup();
               break;
             case "AudioPlayback:Start":
               this.audioPlaybackStarted();
               break;
             case "AudioPlayback:Stop":
               this.audioPlaybackStopped();
               break;
+              
+            case "Forms:ShowDropDown": {
+              if (!this._selectParentHelper) {
+                this._selectParentHelper =
+                  Cu.import("resource://gre/modules/SelectParentHelper.jsm", {}).SelectParentHelper;
+              }
+
+              let menulist = document.getElementById(this.getAttribute("selectmenulist"));
+              menulist.menupopup.style.direction = data.direction;
+              this._selectParentHelper.populate(menulist, data.options, data.selectedIndex, this._fullZoom);
+              this._selectParentHelper.open(this, menulist, data.rect);
+              break;
+            }
+
+            case "Forms:HideDropDown": {
+              if (this._selectParentHelper) {
+                let menulist = document.getElementById(this.getAttribute("selectmenulist"));
+                this._selectParentHelper.hide(menulist, this);
+              }
+              break;
+            }
+
           }
           return undefined;
         ]]></body>
       </method>
 
+
+
       <method name="receiveMessage">
         <parameter name="aMessage"/>
         <body><![CDATA[
           return this._receiveMessage(aMessage);
         ]]></body>
       </method>
 
       <method name="observe">
--- a/toolkit/content/widgets/remote-browser.xml
+++ b/toolkit/content/widgets/remote-browser.xml
@@ -456,29 +456,16 @@
               break;
             case "ImageDocumentLoaded":
               this._imageDocument = {
                 width: data.width,
                 height: data.height
               };
               break;
 
-            case "Forms:ShowDropDown": {
-              if (!this._selectParentHelper) {
-                this._selectParentHelper =
-                  Cu.import("resource://gre/modules/SelectParentHelper.jsm", {}).SelectParentHelper;
-              }
-
-              let menulist = document.getElementById(this.getAttribute("selectmenulist"));
-              menulist.menupopup.style.direction = data.direction;
-              this._selectParentHelper.populate(menulist, data.options, data.selectedIndex, this._fullZoom);
-              this._selectParentHelper.open(this, menulist, data.rect);
-              break;
-            }
-
             case "FullZoomChange": {
               this._fullZoom = data.value;
               let event = document.createEvent("Events");
               event.initEvent("FullZoomChange", true, false);
               this.dispatchEvent(event);
               break;
             }
 
@@ -492,24 +479,16 @@
 
             case "ZoomChangeUsingMouseWheel": {
               let event = document.createEvent("Events");
               event.initEvent("ZoomChangeUsingMouseWheel", true, false);
               this.dispatchEvent(event);
               break;
             }
 
-            case "Forms:HideDropDown": {
-              if (this._selectParentHelper) {
-                let menulist = document.getElementById(this.getAttribute("selectmenulist"));
-                this._selectParentHelper.hide(menulist, this);
-              }
-              break;
-            }
-
             case "DOMFullscreen:RequestExit": {
               let windowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                                       .getInterface(Components.interfaces.nsIDOMWindowUtils);
               windowUtils.exitFullscreen();
               break;
             }
 
             case "DOMFullscreen:RequestRollback": {