Optimize the panel attach method to no append if there is a
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2008 22:28:55 +0000 (22:28 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2008 22:28:55 +0000 (22:28 +0000)
parentNode already.

Reviewed by Adam Roben.

* page/inspector/Panel.js:
(WebInspector.Panel.prototype.attach): Don't append to main-panels
if the panel element already has a parentNode.

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

WebCore/ChangeLog
WebCore/page/inspector/Panel.js

index 49da4fb..9fdca8b 100644 (file)
@@ -1,5 +1,16 @@
 2008-05-13  Timothy Hatcher  <timothy@apple.com>
 
 2008-05-13  Timothy Hatcher  <timothy@apple.com>
 
+        Optimize the panel attach method to no append if there is a
+        parentNode already.
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/Panel.js:
+        (WebInspector.Panel.prototype.attach): Don't append to main-panels
+        if the panel element already has a parentNode.
+
+2008-05-13  Timothy Hatcher  <timothy@apple.com>
+
         Add Widget::isPluginView so the JavaScriptDebugServer can identify
         plugins that need to be paused during debugging. This will be used
         in a upcoming commit.
         Add Widget::isPluginView so the JavaScriptDebugServer can identify
         plugins that need to be paused during debugging. This will be used
         in a upcoming commit.
index edf5751..06a2ca7 100644 (file)
@@ -97,7 +97,8 @@ WebInspector.Panel.prototype = {
 
     attach: function()
     {
 
     attach: function()
     {
-        document.getElementById("main-panels").appendChild(this.element);
+        if (!this.element.parentNode)
+            document.getElementById("main-panels").appendChild(this.element);
     }
 }
 
     }
 }