Bug 1389495 support select in OOP sidebar, r?kmag
MozReview-Commit-ID: 3x4vzcSm2fE
--- 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>