Bug 1381321: Support <select> dropdowns in OOP options browsers. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 16 Jul 2017 12:51:00 -0700
changeset 609459 cf8dc6de8c334265cff2163e82351beb9252e72a
parent 609444 43676eab0672b3e86b33dcad9d672ac07e4c562f
child 609463 430fc04a23941b7ac7e5652148f7a37d345345a7
push id68580
push usermaglione.k@gmail.com
push dateSun, 16 Jul 2017 19:51:37 +0000
reviewersaswan
bugs1381321
milestone56.0a1
Bug 1381321: Support <select> dropdowns in OOP options browsers. r?aswan MozReview-Commit-ID: 1hYgY7s0a6V
toolkit/content/xul.css
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -1010,16 +1010,17 @@ menulist {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist");
 }
 
 menulist[popuponly="true"] {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-popuponly");
   -moz-appearance: none !important;
   margin: 0 !important;
   height: 0 !important;
+  min-height: 0 !important;
   border: 0 !important;
 }
 
 menulist[editable="true"] {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-editable");
 }
 
 menulist[type="description"] {
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -3709,16 +3709,17 @@ var gDetailView = {
 
   async createOptionsBrowser(parentNode) {
     let browser = document.createElement("browser");
     browser.setAttribute("type", "content");
     browser.setAttribute("disableglobalhistory", "true");
     browser.setAttribute("id", "addon-options");
     browser.setAttribute("class", "inline-options-browser");
     browser.setAttribute("forcemessagemanager", "true");
+    browser.setAttribute("selectmenulist", "ContentSelectDropdown");
 
     let {optionsURL} = this._addon;
     let remote = !E10SUtils.canLoadURIInProcess(optionsURL, Services.appinfo.PROCESS_TYPE_DEFAULT);
 
     let readyPromise;
     if (remote) {
       browser.setAttribute("remote", "true");
       browser.setAttribute("remoteType", E10SUtils.EXTENSION_REMOTE_TYPE);
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -64,16 +64,26 @@
       <menuitem id="menuitem_findUpdates" command="cmd_findItemUpdates"
                 label="&cmd.findUpdates.label;"
                 accesskey="&cmd.findUpdates.accesskey;"/>
       <menuitem id="menuitem_about" command="cmd_showItemAbout"
                 label="&cmd.about.label;"
                 accesskey="&cmd.about.accesskey;"/>
     </menupopup>
 
+    <menulist popuponly="true" id="ContentSelectDropdown" hidden="true">
+      <menupopup rolluponmousewheel="true"
+                 activateontab="true" position="after_start"
+                 level="parent"
+#ifdef XP_WIN
+                 consumeoutsideclicks="false" ignorekeys="shortcuts"
+#endif
+        />
+    </menulist>
+
     <tooltip id="addonitem-tooltip"/>
   </popupset>
 
   <!-- global commands - these act on all addons, or affect the addons manager
        in some other way -->
   <commandset id="globalCommandSet">
     <!-- XXXsw remove useless oncommand attribute once bug 371900 is fixed -->
     <command id="cmd_focusSearch" oncommand=";"/>