Bug 1264555 - Remove unused node parameter in canAddHTMLChild; r=jdescottes draft
authorPatrick Brosset <pbrosset@mozilla.com>
Thu, 14 Apr 2016 11:03:59 +0200
changeset 350852 2d9df2e83f2e65b87a70375070a86ee07e1fff20
parent 350851 c61fcac04879527762383a702a7d39957085aca3
child 350896 4909a57deb58eb9f8d544aad6d65e55a7d16427b
push id15428
push userpbrosset@mozilla.com
push dateThu, 14 Apr 2016 10:13:37 +0000
reviewersjdescottes
bugs1264555
milestone48.0a1
Bug 1264555 - Remove unused node parameter in canAddHTMLChild; r=jdescottes MozReview-Commit-ID: 29I9fYJu5td
devtools/client/inspector/inspector-panel.js
--- a/devtools/client/inspector/inspector-panel.js
+++ b/devtools/client/inspector/inspector-panel.js
@@ -1047,27 +1047,27 @@ InspectorPanel.prototype = {
       button.setAttribute("tooltiptext", strings.GetStringFromName("inspector.collapsePane"));
     }
   },
 
   /**
    * Create a new node as the last child of the current selection, expand the
    * parent and select the new node.
    */
-  addNode: Task.async(function*() {
-    let root = this.selection.nodeFront;
-    if (!this.canAddHTMLChild(root)) {
+  addNode: Task.async(function* () {
+    if (!this.canAddHTMLChild()) {
       return;
     }
 
     let html = "<div></div>";
 
     // Insert the html and expect a childList markup mutation.
     let onMutations = this.once("markupmutation");
-    let {nodes} = yield this.walker.insertAdjacentHTML(root, "beforeEnd", html);
+    let {nodes} = yield this.walker.insertAdjacentHTML(this.selection.nodeFront,
+                                                       "beforeEnd", html);
     yield onMutations;
 
     // Select the new node (this will auto-expand its parent).
     this.selection.setNodeFront(nodes[0]);
   }),
 
   /**
    * Toggle a pseudo class.