Title: [137974] branches/chromium/1312/Source/WebCore/dom
Revision
137974
Author
[email protected]
Date
2012-12-17 19:47:18 -0800 (Mon, 17 Dec 2012)

Log Message

Merge 137739
BUG=165864
Review URL: https://codereview.chromium.org/11593024

Modified Paths

Diff

Modified: branches/chromium/1312/Source/WebCore/dom/ContainerNode.h (137973 => 137974)


--- branches/chromium/1312/Source/WebCore/dom/ContainerNode.h	2012-12-18 03:44:54 UTC (rev 137973)
+++ branches/chromium/1312/Source/WebCore/dom/ContainerNode.h	2012-12-18 03:47:18 UTC (rev 137974)
@@ -341,18 +341,18 @@
     }
 
     // Returns 0 if there is no next Node.
-    Node* nextNode()
+    PassRefPtr<Node> nextNode()
     {
         if (LIKELY(!hasSnapshot())) {
-            Node* node = m_currentNode.get();
-            if (m_currentNode)
-                m_currentNode = m_currentNode->nextSibling();
+            RefPtr<Node> node = m_currentNode;
+            if (node.get())
+                m_currentNode = node->nextSibling();
             return node;
         }
         Vector<RefPtr<Node> >* nodeVector = m_childNodes.get();
         if (m_currentIndex >= nodeVector->size())
             return 0;
-        return (*nodeVector)[m_currentIndex++].get();
+        return (*nodeVector)[m_currentIndex++];
     }
 
     void takeSnapshot()

Modified: branches/chromium/1312/Source/WebCore/dom/ContainerNodeAlgorithms.cpp (137973 => 137974)


--- branches/chromium/1312/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2012-12-18 03:44:54 UTC (rev 137973)
+++ branches/chromium/1312/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2012-12-18 03:47:18 UTC (rev 137974)
@@ -35,12 +35,12 @@
 void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument(ContainerNode* node)
 {
     ChildNodesLazySnapshot snapshot(node);
-    while (Node* child = snapshot.nextNode()) {
+    while (RefPtr<Node> child = snapshot.nextNode()) {
         // If we have been removed from the document during this loop, then
         // we don't want to tell the rest of our children that they've been
         // inserted into the document because they haven't.
         if (node->inDocument() && child->parentNode() == node)
-            notifyNodeInsertedIntoDocument(child);
+            notifyNodeInsertedIntoDocument(child.get());
     }
 
     if (!node->isElementNode())
@@ -69,12 +69,12 @@
 void ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument(ContainerNode* node)
 {
     ChildNodesLazySnapshot snapshot(node);
-    while (Node* child = snapshot.nextNode()) {
+    while (RefPtr<Node> child = snapshot.nextNode()) {
         // If we have been added to the document during this loop, then we
         // don't want to tell the rest of our children that they've been
         // removed from the document because they haven't.
         if (!node->inDocument() && child->parentNode() == node)
-            notifyNodeRemovedFromDocument(child);
+            notifyNodeRemovedFromDocument(child.get());
     }
 
     if (!node->isElementNode())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to