Bug 1508169, Remove performAction* from nsITreeView.idl in mozilla-central. r=peterv, johannh
authorAlex Vincent <ajvincent@gmail.com>
Sat, 24 Aug 2019 00:49:55 +0200
changeset 553508 0f58e37830b0cfa0f34499d84fdc9ae264b312f2
parent 553507 c8773774d96976aea43a9540546d023688d81920
child 553509 fce0b326cd318bf435d4e4c54ae331618059e073
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, johannh
bugs1508169
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508169, Remove performAction* from nsITreeView.idl in mozilla-central. r=peterv, johannh performAction, performActionOnRow and performActionOnCell are methods of the nsITreeView interface that are never called. This is to remove these methods. A comm-central patch will be along shortly. Differential Revision: https://phabricator.services.mozilla.com/D39273
accessible/tests/mochitest/treeview.js
browser/base/content/pageinfo/pageInfo.js
browser/base/content/pageinfo/pageInfo.xul
browser/components/places/content/treeView.js
browser/components/preferences/in-content/search.js
browser/components/sessionstore/content/aboutSessionRestore.js
browser/locales/en-US/browser/pageInfo.ftl
dom/webidl/TreeView.webidl
layout/xul/tree/nsITreeView.idl
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeContentView.h
security/manager/pki/nsASN1Tree.cpp
security/manager/ssl/nsCertTree.cpp
toolkit/components/viewconfig/content/config.js
--- a/accessible/tests/mochitest/treeview.js
+++ b/accessible/tests/mochitest/treeview.js
@@ -158,19 +158,16 @@ nsTreeView.prototype = {
     data.colsText[aCol.id] = aValue;
   },
   setCellValue: function setCellValue(aRow, aCol, aValue) {
     var data = this.getDataForIndex(aRow);
     data.value = aValue;
 
     this.mTree.invalidateCell(aRow, aCol);
   },
-  performAction: function performAction(aAction) {},
-  performActionOnRow: function performActionOnRow(aAction, aRow) {},
-  performActionOnCell: function performActionOnCell(aAction, aRow, aCol) {},
 
   // ////////////////////////////////////////////////////////////////////////////
   // public implementation
 
   appendItem: function appendItem(aText) {
     this.mData.push(new treeItem(aText));
   },
 
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -78,29 +78,16 @@ pageInfoTreeView.prototype = {
   clear() {
     if (this.tree) {
       this.tree.rowCountChanged(0, -this.rows);
     }
     this.rows = 0;
     this.data = [];
   },
 
-  handleCopy(row) {
-    return row < 0 || this.copycol < 0
-      ? ""
-      : this.data[row][this.copycol] || "";
-  },
-
-  performActionOnRow(action, row) {
-    if (action == "copy") {
-      var data = this.handleCopy(row);
-      this.tree.treeBody.parentNode.setAttribute("copybuffer", data);
-    }
-  },
-
   onPageMediaSort(columnname) {
     var tree = document.getElementById(this.treeid);
     var treecol = tree.columns.getNamedColumn(columnname);
 
     this.sortdir = gTreeUtils.sort(
       tree,
       this,
       this.data,
@@ -165,18 +152,16 @@ pageInfoTreeView.prototype = {
   getCellValue(row, column) {},
   toggleOpenState(index) {},
   cycleHeader(col) {},
   selectionChanged() {},
   cycleCell(row, column) {},
   isEditable(row, column) {
     return false;
   },
-  performAction(action) {},
-  performActionOnCell(action, row, column) {},
 };
 
 // mmm, yummy. global variables.
 var gDocInfo = null;
 var gImageElement = null;
 
 // column number to help using the data array
 const COL_IMAGE_ADDRESS = 0;
@@ -279,29 +264,16 @@ var loadContextInfo = Services.loadConte
 var diskStorage = cacheService.diskCacheStorage(loadContextInfo, false);
 
 const nsICookiePermission = Ci.nsICookiePermission;
 const nsIPermissionManager = Ci.nsIPermissionManager;
 
 const nsICertificateDialogs = Ci.nsICertificateDialogs;
 const CERTIFICATEDIALOGS_CONTRACTID = "@mozilla.org/nsCertificateDialogs;1";
 
-// clipboard helper
-function getClipboardHelper() {
-  try {
-    return Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
-      Ci.nsIClipboardHelper
-    );
-  } catch (e) {
-    // do nothing, later code will handle the error
-    return null;
-  }
-}
-const gClipboardHelper = getClipboardHelper();
-
 // namespaces, don't need all of these yet...
 const XLinkNS = "http://www.w3.org/1999/xlink";
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 const XMLNS = "http://www.w3.org/XML/1998/namespace";
 const XHTMLNS = "http://www.w3.org/1999/xhtml";
 const XHTML2NS = "http://www.w3.org/2002/06/xhtml2";
 
 const XHTMLNSre = "^http://www.w3.org/1999/xhtml$";
@@ -1183,50 +1155,16 @@ function formatDate(datestr, unknown) {
 
   const dateTimeFormatter = new Services.intl.DateTimeFormat(undefined, {
     dateStyle: "long",
     timeStyle: "long",
   });
   return dateTimeFormatter.format(date);
 }
 
-function doCopy() {
-  if (!gClipboardHelper) {
-    return;
-  }
-
-  var elem = document.commandDispatcher.focusedElement;
-
-  if (elem && elem.localName == "tree") {
-    var view = elem.view;
-    var selection = view.selection;
-    var text = [],
-      tmp = "";
-    var min = {},
-      max = {};
-
-    var count = selection.getRangeCount();
-
-    for (var i = 0; i < count; i++) {
-      selection.getRangeAt(i, min, max);
-
-      for (var row = min.value; row <= max.value; row++) {
-        view.performActionOnRow("copy", row);
-
-        tmp = elem.getAttribute("copybuffer");
-        if (tmp) {
-          text.push(tmp);
-        }
-        elem.removeAttribute("copybuffer");
-      }
-    }
-    gClipboardHelper.copyString(text.join("\n"));
-  }
-}
-
 function doSelectAllMedia() {
   var tree = document.getElementById("imagetree");
 
   if (tree) {
     tree.view.selection.selectAll();
   }
 }
 
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -42,36 +42,33 @@
   <stringbundleset id="pageinfobundleset">
     <stringbundle id="pkiBundle" src="chrome://pippki/locale/pippki.properties"/>
     <stringbundle id="browserBundle" src="chrome://browser/locale/browser.properties"/>
   </stringbundleset>
 
   <commandset id="pageInfoCommandSet">
     <command id="cmd_close"     oncommand="window.close();"/>
     <command id="cmd_help"      oncommand="doHelpButton();"/>
-    <command id="cmd_copy"      oncommand="doCopy();"/>
     <command id="cmd_selectall" oncommand="doSelectAll();"/>
   </commandset>
 
   <keyset id="pageInfoKeySet">
     <key data-l10n-id="close-dialog" data-l10n-attrs="key" modifiers="accel" command="cmd_close"/>
     <key keycode="VK_ESCAPE" command="cmd_close"/>
 #ifdef XP_MACOSX
     <key key="." modifiers="meta"  command="cmd_close"/>
 #else
     <key keycode="VK_F1" command="cmd_help"/>
 #endif
-    <key data-l10n-id="copy"       data-l10n-attrs="key" modifiers="accel" command="cmd_copy"/>
     <key data-l10n-id="select-all" data-l10n-attrs="key" modifiers="accel" command="cmd_selectall"/>
     <key data-l10n-id="select-all" data-l10n-attrs="key" modifiers="alt"   command="cmd_selectall"/>
   </keyset>
 
   <menupopup id="picontext">
     <menuitem id="menu_selectall" data-l10n-id="menu-select-all" command="cmd_selectall"/>
-    <menuitem id="menu_copy"      data-l10n-id="menu-copy"      command="cmd_copy"/>
   </menupopup>
 
   <vbox id="topBar">
     <radiogroup id="viewGroup" class="chromeclass-toolbar" orient="horizontal">
       <radio id="generalTab"  data-l10n-id="general-tab"
            oncommand="showTab('general');"/>
       <radio id="mediaTab"    data-l10n-id="media-tab"
            oncommand="showTab('media');" hidden="true"/>
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -1825,12 +1825,9 @@ PlacesTreeView.prototype = {
       }
 
       this._invalidateCellValue(aNode, this.COLUMN_TYPE_TITLE);
     }
   },
 
   selectionChanged() {},
   cycleCell(aRow, aColumn) {},
-  performAction(aAction) {},
-  performActionOnRow(aAction, aRow) {},
-  performActionOnCell(aAction, aRow, aColumn) {},
 };
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -787,12 +787,9 @@ EngineView.prototype = {
         .editKeyword(this._engineStore.engines[index], value)
         .then(valid => {
           if (!valid) {
             document.getElementById("engineList").startEditing(index, column);
           }
         });
     }
   },
-  performAction(action) {},
-  performActionOnRow(action, index) {},
-  performActionOnCell(action, index, column) {},
 };
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -459,14 +459,12 @@ var treeView = {
       return gTreeData[idx].src || null;
     }
     return null;
   },
 
   cycleHeader(column) {},
   cycleCell(idx, column) {},
   selectionChanged() {},
-  performAction(action) {},
-  performActionOnCell(action, index, column) {},
   getColumnProperties(column) {
     return "";
   },
 };
--- a/browser/locales/en-US/browser/pageInfo.ftl
+++ b/browser/locales/en-US/browser/pageInfo.ftl
@@ -1,21 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/. --
 
 page-info-window =
     .style = width: 600px; min-height: 550px;
 
-copy =
-    .key = C
-menu-copy =
-    .label = Copy
-    .accesskey = C
-
 select-all =
     .key = A
 menu-select-all =
     .label = Select All
     .accesskey = A
 
 close-dialog =
     .key = w
--- a/dom/webidl/TreeView.webidl
+++ b/dom/webidl/TreeView.webidl
@@ -179,26 +179,9 @@ interface TreeView
   [Throws]
   void setCellValue(long row, TreeColumn column, DOMString value);
 
   /**
    * setCellText is called when the contents of the cell have been edited by the user.
    */
   [Throws]
   void setCellText(long row, TreeColumn column, DOMString value);
-
-  /**
-   * A command API that can be used to invoke commands on the selection.  The tree
-   * will automatically invoke this method when certain keys are pressed.  For example,
-   * when the DEL key is pressed, performAction will be called with the "delete" string.
-   */
-  void performAction(DOMString action);
-
-  /**
-   * A command API that can be used to invoke commands on a specific row.
-   */
-  void performActionOnRow(DOMString action, long row);
-
-  /**
-   * A command API that can be used to invoke commands on a specific cell.
-   */
-  void performActionOnCell(DOMString action, long row, TreeColumn column);
 };
--- a/layout/xul/tree/nsITreeView.idl
+++ b/layout/xul/tree/nsITreeView.idl
@@ -165,26 +165,9 @@ interface nsITreeView : nsISupports
    * This method is only called for columns of type other than |text|.
    */
   void setCellValue(in long row, in TreeColumn col, in AString value);
 
   /**
    * setCellText is called when the contents of the cell have been edited by the user.
    */
   void setCellText(in long row, in TreeColumn col, in AString value);
-
-  /**
-   * A command API that can be used to invoke commands on the selection.  The tree
-   * will automatically invoke this method when certain keys are pressed.  For example,
-   * when the DEL key is pressed, performAction will be called with the "delete" string.
-   */
-  void performAction(in wstring action);
-
-  /**
-   * A command API that can be used to invoke commands on a specific row.
-   */
-  void performActionOnRow(in wstring action, in long row);
-
-  /**
-   * A command API that can be used to invoke commands on a specific cell.
-   */
-  void performActionOnCell(in wstring action, in long row, in TreeColumn col);
 };
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -684,30 +684,16 @@ nsTreeContentView::SetCellText(int32_t a
                                const nsAString& aValue) {
   NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
   SetCellText(aRow, *aCol, aValue, rv);
   return rv.StealNSResult();
 }
 
-NS_IMETHODIMP
-nsTreeContentView::PerformAction(const char16_t* aAction) { return NS_OK; }
-
-NS_IMETHODIMP
-nsTreeContentView::PerformActionOnRow(const char16_t* aAction, int32_t aRow) {
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsTreeContentView::PerformActionOnCell(const char16_t* aAction, int32_t aRow,
-                                       nsTreeColumn* aCol) {
-  return NS_OK;
-}
-
 Element* nsTreeContentView::GetItemAtIndex(int32_t aIndex,
                                            ErrorResult& aError) {
   if (!IsValidRowIndex(aIndex)) {
     aError.Throw(NS_ERROR_INVALID_ARG);
     return nullptr;
   }
 
   return mRows[aIndex]->mContent;
--- a/layout/xul/tree/nsTreeContentView.h
+++ b/layout/xul/tree/nsTreeContentView.h
@@ -82,20 +82,16 @@ class nsTreeContentView final : public n
   void SelectionChanged() {}
   void CycleCell(int32_t aRow, nsTreeColumn& aColumn) {}
   bool IsEditable(int32_t aRow, nsTreeColumn& aColumn,
                   mozilla::ErrorResult& aError);
   void SetCellValue(int32_t aRow, nsTreeColumn& aColumn,
                     const nsAString& aValue, mozilla::ErrorResult& aError);
   void SetCellText(int32_t aRow, nsTreeColumn& aColumn, const nsAString& aText,
                    mozilla::ErrorResult& aError);
-  void PerformAction(const nsAString& aAction) {}
-  void PerformActionOnRow(const nsAString& aAction, int32_t aRow) {}
-  void PerformActionOnCell(const nsAString& aAction, int32_t aRow,
-                           nsTreeColumn& aColumn) {}
   Element* GetItemAtIndex(int32_t aRow, mozilla::ErrorResult& aError);
   int32_t GetIndexOfItem(Element* aItem);
 
   NS_DECL_NSITREEVIEW
 
   // nsIDocumentObserver
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
--- a/security/manager/pki/nsASN1Tree.cpp
+++ b/security/manager/pki/nsASN1Tree.cpp
@@ -306,27 +306,16 @@ nsNSSASN1Tree::SetCellValue(int32_t, nsT
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::SetCellText(int32_t, nsTreeColumn*, const nsAString&) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::PerformAction(const char16_t*) { return NS_OK; }
-
-NS_IMETHODIMP
-nsNSSASN1Tree::PerformActionOnRow(const char16_t*, int32_t) { return NS_OK; }
-
-NS_IMETHODIMP
-nsNSSASN1Tree::PerformActionOnCell(const char16_t*, int32_t, nsTreeColumn*) {
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsNSSASN1Tree::CanDrop(int32_t, int32_t, mozilla::dom::DataTransfer*,
                        bool* _retval) {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -1041,30 +1041,16 @@ nsCertTree::SetCellValue(int32_t row, ns
 }
 
 NS_IMETHODIMP
 nsCertTree::SetCellText(int32_t row, nsTreeColumn* col,
                         const nsAString& value) {
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsCertTree::PerformAction(const char16_t* action) { return NS_OK; }
-
-NS_IMETHODIMP
-nsCertTree::PerformActionOnRow(const char16_t* action, int32_t row) {
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCertTree::PerformActionOnCell(const char16_t* action, int32_t row,
-                                nsTreeColumn* col) {
-  return NS_OK;
-}
-
 #ifdef DEBUG_CERT_TREE
 void nsCertTree::dumpMap() {
   for (int i = 0; i < mNumOrgs; i++) {
     nsAutoString org(mTreeArray[i].orgName);
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("ORG[%s]", NS_LossyConvertUTF16toASCII(org).get()));
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("OPEN[%d]", mTreeArray[i].open));
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
--- a/toolkit/components/viewconfig/content/config.js
+++ b/toolkit/components/viewconfig/content/config.js
@@ -145,19 +145,16 @@ var view = {
   },
   selectionChanged() {},
   cycleCell(row, col) {},
   isEditable(row, col) {
     return false;
   },
   setCellValue(row, col, value) {},
   setCellText(row, col, value) {},
-  performAction(action) {},
-  performActionOnRow(action, row) {},
-  performActionOnCell(action, row, col) {},
   isSeparator(index) {
     return false;
   },
 };
 
 // find the index in gPrefView of a pref object
 // or -1 if it does not exist in the filtered view
 function getViewIndexOfPref(pref) {