Bug 1570679 - fix de-xbl fallout to make tooltips work for content in the conversation-browser. r=aleca
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 20 Aug 2019 13:57:39 +0300
changeset 36178 0e0b6fb625ce7dd891cc83e926d38296c4e85bc5
parent 36177 7b046aa7c4afc118571eafe4674d3ae65d83558b
child 36179 da67254eae57f956d8bef5ed564f4975a29c0c5a
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaleca
bugs1570679
Bug 1570679 - fix de-xbl fallout to make tooltips work for content in the conversation-browser. r=aleca
mail/components/im/content/chat-conversation.js
mail/components/im/content/chat-messenger.js
--- a/mail/components/im/content/chat-conversation.js
+++ b/mail/components/im/content/chat-conversation.js
@@ -16,16 +16,22 @@
 
   /**
    * The MozChatConversation widget displays the entire chat conversation
    * including status notifications
    *
    * @extends {MozXULElement}
    */
   class MozChatConversation extends MozXULElement {
+    static get inheritedAttributes() {
+      return {
+        "browser": "autoscrollpopup",
+      };
+    }
+
     constructor() {
       super();
 
       this.observer = {
         // @see {nsIObserver}
         observe: (subject, topic, data) => {
           if (topic == "conversation-loaded") {
             if (subject != this.convBrowser) {
@@ -162,18 +168,16 @@
 
       let nbox = document.createXULElement("vbox");
       nbox.setAttribute("flex", "1");
 
       this.convBrowser = document.createXULElement("browser",
         { is: "conversation-browser" });
       this.convBrowser.setAttribute("flex", "1");
       this.convBrowser.setAttribute("type", "content");
-      this.convBrowser.setAttribute("inherits",
-        "tooltip=contenttooltip,contextmenu=contentcontextmenu,autoscrollpopup");
 
       this.progressBar = document.createElementNS("http://www.w3.org/1999/xhtml",
         "progress");
       this.progressBar.setAttribute("hidden", "hidden");
 
       this.findbar = document.createXULElement("findbar");
       this.findbar.setAttribute("reversed", "true");
 
--- a/mail/components/im/content/chat-messenger.js
+++ b/mail/components/im/content/chat-messenger.js
@@ -317,17 +317,17 @@ var chatTabType = {
   onEvent(aEvent, aTab) {},
   getBrowser(aTab) {
     let panel = document.getElementById("conversationsDeck").selectedPanel;
     if (panel == document.getElementById("logDisplay")) {
       if (document.getElementById("logDisplayDeck").selectedPanel ==
           document.getElementById("logDisplayBrowserBox"))
         return document.getElementById("conv-log-browser");
     } else if (panel && panel.localName == "chat-conversation") {
-      return panel.browser;
+      return panel.convBrowser;
     }
     return null;
   },
   getFindbar(aTab) {
     let panel = document.getElementById("conversationsDeck").selectedPanel;
     if (panel == document.getElementById("logDisplay")) {
       if (document.getElementById("logDisplayDeck").selectedPanel ==
           document.getElementById("logDisplayBrowserBox"))
@@ -731,18 +731,18 @@ var chatHandler = {
       });
     } else if (item.localName == "richlistitem" && item.getAttribute("is") == "chat-imconv") {
       let convDeck = document.getElementById("conversationsDeck");
       if (!item.convView) {
         let conv = document.createXULElement("chat-conversation");
         convDeck.appendChild(conv);
         conv.conv = item.conv;
         conv.tab = item;
-        conv.setAttribute("contentcontextmenu", "chatConversationContextMenu");
-        conv.setAttribute("contenttooltip", "imTooltip");
+        conv.setAttribute("contextmenu", "chatConversationContextMenu");
+        conv.setAttribute("tooltip", "imTooltip");
         item.convView = conv;
         document.getElementById("contextSplitter").hidden = false;
         document.getElementById("contextPane").hidden = false;
         conv.editor.addEventListener("contextmenu", (e) => {
           // Stash away the original event's parent and range for later use.
           gRangeParent = e.rangeParent;
           gRangeOffset = e.rangeOffset;
           let popup = document.getElementById("chatContextMenu");