Bug 1281931 - remove unused parameters from Selection constructor; r?gregtatum draft
authorTom Tromey <tom@tromey.com>
Tue, 26 Jul 2016 13:35:22 -0600
changeset 398623 a10bbe555dd4ff8c0b48c0da8fe48275fff15193
parent 398622 ce1c29c6149a03ad36b37c11e43ce92e9b7532a0
child 398624 6ab20f379105a7b7780d1f24895225ff6daa4579
push id25584
push userbmo:ttromey@mozilla.com
push dateTue, 09 Aug 2016 14:55:09 +0000
reviewersgregtatum
bugs1281931
milestone51.0a1
Bug 1281931 - remove unused parameters from Selection constructor; r?gregtatum MozReview-Commit-ID: 51wgSBIOcp8
devtools/client/framework/selection.js
--- a/devtools/client/framework/selection.js
+++ b/devtools/client/framework/selection.js
@@ -9,17 +9,17 @@
 const { Cu } = require("chrome");
 const nodeConstants = require("devtools/shared/dom-node-constants");
 const { getRootBindingParent } = require("devtools/shared/layout/utils");
 var EventEmitter = require("devtools/shared/event-emitter");
 
 /**
  * API
  *
- *   new Selection(walker=null, node=null, track={attributes,detached});
+ *   new Selection(walker=null)
  *   destroy()
  *   node (readonly)
  *   setNode(node, origin="unknown")
  *
  * Helpers:
  *
  *   window
  *   document
@@ -40,40 +40,33 @@ var EventEmitter = require("devtools/sha
  *   isDocumentNode()
  *   isDocumentTypeNode()
  *   isDocumentFragmentNode()
  *   isNotationNode()
  *
  * Events:
  *   "new-node" when the inner node changed
  *   "before-new-node" when the inner node is set to change
- *   "attribute-changed" when an attribute is changed (only if tracked)
+ *   "attribute-changed" when an attribute is changed
  *   "detached" when the node (or one of its parents) is removed from
- *   the document (only if tracked)
+ *   the document
  *   "reparented" when the node (or one of its parents) is moved under
- *   a different node (only if tracked)
+ *   a different node
  */
 
 /**
  * A Selection object. Hold a reference to a node.
  * Includes some helpers, fire some helpful events.
- *
- * @param node Inner node.
- *    Can be null. Can be (un)set in the future via the "node" property;
- * @param trackAttribute Tell if events should be fired when the attributes of
- *    the node change.
- *
  */
-function Selection(walker, node = null, track = {attributes: true, detached: true}) {
+function Selection(walker) {
   EventEmitter.decorate(this);
 
   this._onMutations = this._onMutations.bind(this);
-  this.track = track;
   this.setWalker(walker);
-  this.setNode(node);
+  this.setNode(null);
 }
 
 exports.Selection = Selection;
 
 Selection.prototype = {
   _walker: null,
   _node: null,