Bug 1389495 support select in OOP sidebar, r?kmag draft
authorShane Caraveo <scaraveo@mozilla.com>
Mon, 14 Aug 2017 10:20:08 -0700
changeset 645996 de756782125522f401ff839d78cf7b3150021f2b
parent 645995 661c6dd130e5abf0689c04fdd63597ad2e2214dd
child 726098 5f7c3a5a515da40b4d7d9502ce5355964a40b055
push id73961
push usermixedpuppy@gmail.com
push dateMon, 14 Aug 2017 17:20:40 +0000
reviewerskmag
bugs1389495
milestone57.0a1
Bug 1389495 support select in OOP sidebar, r?kmag MozReview-Commit-ID: 3x4vzcSm2fE
browser/base/content/webext-panels.js
browser/base/content/webext-panels.xul
--- a/browser/base/content/webext-panels.js
+++ b/browser/base/content/webext-panels.js
@@ -31,16 +31,17 @@ function getBrowser(sidebar) {
   browser.setAttribute("id", "webext-panels-browser");
   browser.setAttribute("type", "content");
   browser.setAttribute("flex", "1");
   browser.setAttribute("disableglobalhistory", "true");
   browser.setAttribute("webextension-view-type", "sidebar");
   browser.setAttribute("context", "contentAreaContextMenu");
   browser.setAttribute("tooltip", "aHTMLTooltip");
   browser.setAttribute("autocompletepopup", "PopupAutoComplete");
+  browser.setAttribute("selectmenulist", "ContentSelectDropdown");
   browser.setAttribute("onclick", "window.parent.contentAreaClick(event, true);");
 
   let readyPromise;
   if (sidebar.remote) {
     browser.setAttribute("remote", "true");
     browser.setAttribute("remoteType",
                          E10SUtils.getRemoteTypeForURI(sidebar.uri, true,
                                                        E10SUtils.EXTENSION_REMOTE_TYPE));
--- a/browser/base/content/webext-panels.xul
+++ b/browser/base/content/webext-panels.xul
@@ -63,12 +63,26 @@
                                  document.popupNode = this.triggerNode;
                                return gContextMenu.shouldDisplay;"
                onpopuphiding="if (event.target != this)
                                 return;
                               gContextMenu.hiding();
                               gContextMenu = null;">
 #include browser-context.inc
     </menupopup>
+
+    <!-- for select dropdowns. The menupopup is what shows the list of options,
+         and the popuponly menulist makes things like the menuactive attributes
+         work correctly on the menupopup. ContentSelectDropdown expects the
+         popuponly menulist to be its immediate parent. -->
+    <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>
   </popupset>
 
   <commandset id="editMenuCommands"/>
 </page>