Web Inspector: Start using Node.prototype.remove
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jul 2015 06:30:37 +0000 (06:30 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jul 2015 06:30:37 +0000 (06:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147304

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.elementDragStart):
(WebInspector.elementDragEnd):
(WebInspector.revertDomChanges):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._updateSearchHighlight.updateEntryHide):
(WebInspector.DOMTreeElement.prototype._updateSearchHighlight):
(WebInspector.DOMTreeElement.prototype.remove.removeNodeCallback):
(WebInspector.DOMTreeElement.prototype.remove):
* UserInterface/Views/Resizer.js:
(WebInspector.Resizer.prototype._resizerMouseDown):
(WebInspector.Resizer.prototype._resizerMouseUp):
(WebInspector.Resizer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/Resizer.js

index 6f4780d..9346f34 100644 (file)
@@ -1,5 +1,26 @@
 2015-07-25  Nikita Vasilyev  <nvasilyev@apple.com>
 
+        Web Inspector: Start using Node.prototype.remove
+        https://bugs.webkit.org/show_bug.cgi?id=147304
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.elementDragStart):
+        (WebInspector.elementDragEnd):
+        (WebInspector.revertDomChanges):
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype._updateSearchHighlight.updateEntryHide):
+        (WebInspector.DOMTreeElement.prototype._updateSearchHighlight):
+        (WebInspector.DOMTreeElement.prototype.remove.removeNodeCallback):
+        (WebInspector.DOMTreeElement.prototype.remove):
+        * UserInterface/Views/Resizer.js:
+        (WebInspector.Resizer.prototype._resizerMouseDown):
+        (WebInspector.Resizer.prototype._resizerMouseUp):
+        (WebInspector.Resizer):
+
+2015-07-25  Nikita Vasilyev  <nvasilyev@apple.com>
+
         Web Inspector: Fix color declaration for not-executed comments
         https://bugs.webkit.org/show_bug.cgi?id=147305
 
index da1d7d3..14c24c7 100644 (file)
@@ -1703,7 +1703,7 @@ WebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, e
     if (element) {
         // Install glass pane
         if (WebInspector._elementDraggingGlassPane)
-            WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+            WebInspector._elementDraggingGlassPane.remove();
 
         var glassPane = document.createElement("div");
         glassPane.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;z-index:1";
@@ -1734,7 +1734,7 @@ WebInspector.elementDragEnd = function(event)
     event.target.ownerDocument.body.style.removeProperty("cursor");
 
     if (WebInspector._elementDraggingGlassPane)
-        WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+        WebInspector._elementDraggingGlassPane.remove();
 
     delete WebInspector._elementDraggingGlassPane;
     delete WebInspector._elementDraggingEventTarget;
@@ -2027,8 +2027,7 @@ WebInspector.revertDomChanges = function(domChanges)
         var entry = domChanges[i];
         switch (entry.type) {
         case "added":
-            if (entry.node.parentElement)
-                entry.node.parentElement.removeChild(entry.node);
+            entry.node.remove();
             break;
         case "changed":
             entry.node.textContent = entry.oldText;
index 7088b39..6829d68 100644 (file)
@@ -120,8 +120,7 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
         {
             switch (entry.type) {
                 case "added":
-                    if (entry.node.parentElement)
-                        entry.node.parentElement.removeChild(entry.node);
+                    entry.node.remove();
                     break;
                 case "changed":
                     entry.node.textContent = entry.oldText;
@@ -1265,7 +1264,7 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
             if (!self.parent)
                 return;
 
-            parentElement.removeChild(self);
+            self.remove();
             parentElement.adjustCollapsedRange();
         }
 
index 893ef6e..076a7c9 100644 (file)
@@ -110,7 +110,7 @@ WebInspector.Resizer = class Resizer extends WebInspector.Object
         // The cursor could change when hovering over links, text, or other elements with cursor cues.
         // FIXME: when Pointer Events support is available this could be implemented by drawing the cursor ourselves.
         if (WebInspector._elementDraggingGlassPane)
-            WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+            WebInspector._elementDraggingGlassPane.remove();
 
         var glassPaneElement = document.createElement("div");
         glassPaneElement.className = "glass-pane-for-drag";
@@ -135,7 +135,7 @@ WebInspector.Resizer = class Resizer extends WebInspector.Object
         document.body.style.removeProperty("cursor");
 
         if (WebInspector._elementDraggingGlassPane) {
-            WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+            WebInspector._elementDraggingGlassPane.remove();
             delete WebInspector._elementDraggingGlassPane;
         }