Title: [130587] trunk/Source/WebCore
Revision
130587
Author
[email protected]
Date
2012-10-06 11:51:05 -0700 (Sat, 06 Oct 2012)

Log Message

If Node X is reachable from _javascript_, all Nodes in the same tree should be kept alive
https://bugs.webkit.org/show_bug.cgi?id=88834

Reviewed by Gavin Barraclough.

Follow-up patch to address some comments by Darin Adler.

* bindings/js/JSNodeCustom.h:
(WebCore::willCreatePossiblyOrphanedTreeByRemoval): Save some space by
collapsing comment lines. Use Node::hasChildNodes() for brevity.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130586 => 130587)


--- trunk/Source/WebCore/ChangeLog	2012-10-06 18:44:15 UTC (rev 130586)
+++ trunk/Source/WebCore/ChangeLog	2012-10-06 18:51:05 UTC (rev 130587)
@@ -1,3 +1,16 @@
+2012-10-06  Geoffrey Garen  <[email protected]>
+
+        If Node X is reachable from _javascript_, all Nodes in the same tree should be kept alive
+        https://bugs.webkit.org/show_bug.cgi?id=88834
+
+        Reviewed by Gavin Barraclough.
+
+        Follow-up patch to address some comments by Darin Adler.
+
+        * bindings/js/JSNodeCustom.h:
+        (WebCore::willCreatePossiblyOrphanedTreeByRemoval): Save some space by
+        collapsing comment lines. Use Node::hasChildNodes() for brevity.
+
 2012-10-06  Benjamin Poulain  <[email protected]>
 
         Fix weird use of KURL's protocolIs

Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.h (130586 => 130587)


--- trunk/Source/WebCore/bindings/js/JSNodeCustom.h	2012-10-06 18:44:15 UTC (rev 130586)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.h	2012-10-06 18:51:05 UTC (rev 130587)
@@ -72,19 +72,15 @@
 // In the C++ DOM, a node tree survives as long as there is a reference to its
 // root. In the _javascript_ DOM, a node tree survives as long as there is a
 // reference to any node in the tree. To model the _javascript_ DOM on top of
-// the C++ DOM, we ensure that the root of every tree has a _javascript_
-// wrapper.
+// the C++ DOM, we ensure that the root of every tree has a _javascript_ wrapper.
 inline void willCreatePossiblyOrphanedTreeByRemoval(Node* root)
 {
     if (root->wrapper())
         return;
 
-    if (!root->isContainerNode())
+    if (!root->hasChildNodes())
         return;
 
-    if (!toContainerNode(root)->hasChildNodes())
-        return;
-
     ScriptState* scriptState = mainWorldScriptState(root->document()->frame());
     if (!scriptState)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to