Title: [133933] trunk/Source/WebCore
Revision
133933
Author
commit-qu...@webkit.org
Date
2012-11-08 12:37:24 -0800 (Thu, 08 Nov 2012)

Log Message

Skip frame owner disconnect when there's no frames
https://bugs.webkit.org/show_bug.cgi?id=101619

Patch by Elliott Sprehn <espr...@chromium.org> on 2012-11-08
Reviewed by Ojan Vafai.

Even when there's no subframes in the document we traverse down every
subtree on Node removal looking for frames to disconnect. This patch
checks document()->frame()->tree()->firstChild() to skip this traversal
if there's no subframes.

No new tests, this just short circuits code for speed.

* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildFrameDisconnector::ChildFrameDisconnector):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133932 => 133933)


--- trunk/Source/WebCore/ChangeLog	2012-11-08 20:33:42 UTC (rev 133932)
+++ trunk/Source/WebCore/ChangeLog	2012-11-08 20:37:24 UTC (rev 133933)
@@ -1,3 +1,20 @@
+2012-11-08  Elliott Sprehn  <espr...@chromium.org>
+
+        Skip frame owner disconnect when there's no frames
+        https://bugs.webkit.org/show_bug.cgi?id=101619
+
+        Reviewed by Ojan Vafai.
+
+        Even when there's no subframes in the document we traverse down every
+        subtree on Node removal looking for frames to disconnect. This patch
+        checks document()->frame()->tree()->firstChild() to skip this traversal
+        if there's no subframes.
+
+        No new tests, this just short circuits code for speed.
+
+        * dom/ContainerNodeAlgorithms.h:
+        (WebCore::ChildFrameDisconnector::ChildFrameDisconnector):
+
 2012-11-08  Erik Arvidsson  <a...@chromium.org>
 
         Wrong error type is thrown for type errors in callbacks

Modified: trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h (133932 => 133933)


--- trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h	2012-11-08 20:33:42 UTC (rev 133932)
+++ trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h	2012-11-08 20:37:24 UTC (rev 133933)
@@ -23,6 +23,7 @@
 #define ContainerNodeAlgorithms_h
 
 #include "Document.h"
+#include "Frame.h"
 #include "HTMLFrameOwnerElement.h"
 #include "InspectorInstrumentation.h"
 #include <wtf/Assertions.h>
@@ -272,6 +273,11 @@
     explicit ChildFrameDisconnector(Node* root, ShouldIncludeRoot shouldIncludeRoot = IncludeRoot)
         : m_root(root)
     {
+        // If we know there's no frames to disconnect then don't bother traversing
+        // the tree looking for them.
+        Frame* frame = root->document()->frame();
+        if (frame && !frame->tree()->firstChild())
+            return;
         collectDescendant(m_root, shouldIncludeRoot);
         rootNodes().add(m_root);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to