Bug 1485702 - Remove unused WalkerFront.search's selectorsOnly argument. r=gl
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 23 Aug 2018 15:36:48 +0000
changeset 831029 77c50281ad2b074a52797cba560444a5585d339c
parent 831028 0503d6eb70a76db7a941202ae05e1bfc448714b2
child 831030 7b78aeca32ed9b21e11e7ff76be8743aced52408
push id118868
push userbmo:zjz@zjz.name
push dateFri, 24 Aug 2018 07:04:39 +0000
reviewersgl
bugs1485702
milestone63.0a1
Bug 1485702 - Remove unused WalkerFront.search's selectorsOnly argument. r=gl Differential Revision: https://phabricator.services.mozilla.com/D4089
devtools/shared/fronts/inspector.js
--- a/devtools/shared/fronts/inspector.js
+++ b/devtools/shared/fronts/inspector.js
@@ -198,38 +198,24 @@ const WalkerFront = FrontClassWithSpec(w
    * For modern servers, results will be searched with using the WalkerActor
    * `search` function (includes tag names, attributes, and text contents).
    * Only 1 result is sent back, and calling the method again with the same
    * query will send the next result. When there are no more results to be sent
    * back, null is sent.
    * @param {String} query
    * @param {Object} options
    *    - "reverse": search backwards
-   *    - "selectorOnly": treat input as a selector string (don't search text
-   *                      tags, attributes, etc)
    */
   search: custom(async function(query, options = { }) {
-    let nodeList;
-    let searchType;
     const searchData = this.searchData = this.searchData || { };
-    const selectorOnly = !!options.selectorOnly;
-
-    if (selectorOnly) {
-      searchType = "selector";
-      nodeList = await this.multiFrameQuerySelectorAll(query);
-    } else {
-      searchType = "search";
-      const result = await this._search(query, options);
-      nodeList = result.list;
-    }
+    const result = await this._search(query, options);
+    const nodeList = result.list;
 
     // If this is a new search, start at the beginning.
-    if (searchData.query !== query ||
-        searchData.selectorOnly !== selectorOnly) {
-      searchData.selectorOnly = selectorOnly;
+    if (searchData.query !== query) {
       searchData.query = query;
       searchData.index = -1;
     }
 
     if (!nodeList.length) {
       return null;
     }
 
@@ -241,17 +227,17 @@ const WalkerFront = FrontClassWithSpec(w
     }
     if (searchData.index < 0) {
       searchData.index = nodeList.length - 1;
     }
 
     // Send back the single node, along with any relevant search data
     const node = await nodeList.item(searchData.index);
     return {
-      type: searchType,
+      type: "search",
       node: node,
       resultsLength: nodeList.length,
       resultsIndex: searchData.index,
     };
   }, {
     impl: "_search"
   }),