Bug 1460201 - Follow-up: remove use of nsISelectionPrivate in C-C. r=bz DONTBUILD
authoraceman <acelists@atlas.sk>
Fri, 11 May 2018 12:35:00 +0200
changeset 23927 c07f80f0706791fca95126b34468485186bf4085
parent 23926 8b6a2017292087c88c17a571319e3fc982f7daea
child 23928 d288b2be548cc054f459e7e927506266aa5f454b
push id14423
push usermozilla@jorgk.com
push dateSat, 12 May 2018 08:06:52 +0000
treeherdercomm-central@c07f80f07067 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1460201
Bug 1460201 - Follow-up: remove use of nsISelectionPrivate in C-C. r=bz DONTBUILD
chat/content/convbrowser.xml
suite/browser/nsTypeAheadFind.js
suite/extensions/debugQA/content/debugQAEditorOverlay.js
--- a/chat/content/convbrowser.xml
+++ b/chat/content/convbrowser.xml
@@ -204,32 +204,28 @@
 
       <method name="enableMagicCopy">
         <body>
           <![CDATA[
           this.contentWindow.controllers.insertControllerAt(0, this);
           this.autoCopyEnabled = Services.clipboard.supportsSelectionClipboard() &&
             Services.prefs.getBoolPref("clipboard.autocopy");
           if (this.autoCopyEnabled) {
-            this.contentWindow.getSelection()
-                .QueryInterface(Ci.nsISelectionPrivate)
-                .addSelectionListener(this);
+            this.contentWindow.getSelection().addSelectionListener(this);
           }
           ]]>
         </body>
       </method>
 
       <method name="disableMagicCopy">
         <body>
           <![CDATA[
           this.contentWindow.controllers.removeController(this);
           if (this.autoCopyEnabled) {
-             this.contentWindow.getSelection()
-                 .QueryInterface(Ci.nsISelectionPrivate)
-                 .removeSelectionListener(this);
+             this.contentWindow.getSelection().removeSelectionListener(this);
           }
           ]]>
         </body>
       </method>
 
       <field name="autoCopyEnabled">false</field>
       <field name="magicCopyPref" readonly="true">"messenger.conversations.selections.magicCopyEnabled"</field>
       <property name="magicCopyEnabled"
--- a/suite/browser/nsTypeAheadFind.js
+++ b/suite/browser/nsTypeAheadFind.js
@@ -330,18 +330,17 @@ typeAheadFind.prototype = {
     this.mEventTarget.addEventListener("blur", this, true);
     // Also watch for the cursor moving within the current field or window.
     var commandDispatcher = this.mEventTarget.ownerDocument.commandDispatcher;
     var editable = commandDispatcher.focusedElement;
     if (editable instanceof Ci.nsIDOMNSEditableElement)
       this.mSelection = editable.editor.selection;
     else
       this.mSelection = commandDispatcher.focusedWindow.getSelection();
-    this.mSelection.QueryInterface(Ci.nsISelectionPrivate)
-                   .addSelectionListener(this);
+    this.mSelection.addSelectionListener(this);
     return false;
   },
   startFind: function(aWindow, aLinks) {
     if (this.mEventTarget)
       this.stopFind(true);
     // Try to get the status bar for the specified window
     this.mXULBrowserWindow =
         aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
--- a/suite/extensions/debugQA/content/debugQAEditorOverlay.js
+++ b/suite/extensions/debugQA/content/debugQAEditorOverlay.js
@@ -44,17 +44,17 @@ function EditorTestSelection()
   if (!selection)
   {
     dump("No selection!\n");
     return;
   }
 
   dump("Selection contains:\n");
   // 3rd param = column to wrap
-  dump(selection.QueryInterface(Ci.nsISelectionPrivate)
+  dump(selection
        .toStringWithFormat("text/plain",
                            kOutputFormatted | kOutputSelectionOnly,
                            0) + "\n");
 
   var output, i;
 
   dump("====== Selection as node and offsets==========\n");
   dump("rangeCount = " + selection.rangeCount + "\n");