Convert the following code: refElem.parendNode.removeChild(refElem) to refElem.remove() Note that when refElem.parendNode is null, refElem.remove() is no-op, it doesn't throw any errors.
<rdar://problem/22000479>
Created attachment 257529 [details] Patch
Comment on attachment 257529 [details] Patch Clearing flags on attachment: 257529 Committed r187405: <http://trac.webkit.org/changeset/187405>
All reviewed patches have been landed. Closing bug.
Comment on attachment 257529 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257529&action=review > Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1269 > - parentElement.removeChild(self); > + self.remove(); Is this valid? Isn't "self" here a WebInspector.TreeElement, not a DOM Element?
(In reply to comment #5) > Comment on attachment 257529 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=257529&action=review > > > Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1269 > > - parentElement.removeChild(self); > > + self.remove(); > > Is this valid? Isn't "self" here a WebInspector.TreeElement, not a DOM > Element? Yes, although this still works, it works in lucky / poor way. This is inside of remove(), so it calls remove() again asynchronously, and only stops this loop because eventually the actual RemoveChild DOM event would remove this tree element from the parent. Lets fix this.