Bug 1645945 - Fix the context menu and date picker for browserAction panels. r=mkmelin a=wsmwk
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 12 Jun 2020 17:12:29 +1200
changeset 39420 937baf187c832a4a2238f84499b5344e1d37c042
parent 39419 9b17071b24c6127577896888722ea80ec5aff8b3
child 39421 5dfeac89e568b2fe44baa99f03f36e932f5e016a
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin, wsmwk
bugs1645945
Bug 1645945 - Fix the context menu and date picker for browserAction panels. r=mkmelin a=wsmwk
mail/components/extensions/ExtensionPopups.jsm
mail/themes/shared/mail/messenger.css
--- a/mail/components/extensions/ExtensionPopups.jsm
+++ b/mail/components/extensions/ExtensionPopups.jsm
@@ -196,20 +196,25 @@ class BasePopup {
 
     let browser = document.createXULElement("browser");
     browser.setAttribute("type", "content");
     browser.setAttribute("disableglobalhistory", "true");
     browser.setAttribute("transparent", "true");
     browser.setAttribute("class", "webextension-popup-browser");
     browser.setAttribute("webextension-view-type", "popup");
     browser.setAttribute("tooltip", "aHTMLTooltip");
-    browser.setAttribute("contextmenu", "contentAreaContextMenu");
+    browser.setAttribute("contextmenu", "mailContext");
     browser.setAttribute("autocompletepopup", "PopupAutoComplete");
     browser.setAttribute("selectmenulist", "ContentSelectDropdown");
     browser.setAttribute("selectmenuconstrained", "false");
+    browser.setAttribute("datetimepicker", "DateTimePickerPanel");
+    browser.setAttribute(
+      "oncontextmenu",
+      "return mailContextOnContextMenu(event);"
+    );
     browser.sameProcessAsFrameLoader = this.extension.groupFrameLoader;
 
     // We only need flex sizing for the sake of the slide-in sub-views of the
     // main menu panel, so that the browser occupies the full width of the view,
     // and also takes up any extra height that's available to it.
     browser.setAttribute("flex", "1");
     stack.setAttribute("flex", "1");
 
--- a/mail/themes/shared/mail/messenger.css
+++ b/mail/themes/shared/mail/messenger.css
@@ -540,16 +540,24 @@ html|span.ac-emphasize-text {
 .autocomplete-richlistitem[type$="-abook"]:not([ac-comment=""]) > .ac-title {
   -moz-box-ordinal-group: 3;
 }
 
 .ac-url-text {
   max-width: unset !important;
 }
 
+/* Date/time picker anchor */
+.popup-anchor {
+  /* should occupy space but not be visible */
+  opacity: 0;
+  pointer-events: none;
+  position: absolute;
+}
+
 html|input[type="number"] {
   margin: 2px 4px;
 }
 /* sizes: chars + 8px padding + 1px borders + spin buttons 14+0+10px  */
 html|input[type="number"].size2 {
   width: calc(2ch + 44px);
 }
 html|input[type="number"].size3 {