[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 12:56:19 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 92d2d74a57529e2e7cba04dc6d7ed27e4c1ab7a8
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 2 11:02:08 2010 +0000
2010-09-02 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Move takeAllChildrenFrom to ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=45066
We're going to reuse this method for XMLDocumentLoader, so it's better
to put it in a more general location.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
* dom/ContainerNode.h:
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::FragmentParsingContext::finished):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index deb1310..b98aff2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-02 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move takeAllChildrenFrom to ContainerNode
+ https://bugs.webkit.org/show_bug.cgi?id=45066
+
+ We're going to reuse this method for XMLDocumentLoader, so it's better
+ to put it in a more general location.
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::takeAllChildrenFrom):
+ * dom/ContainerNode.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::FragmentParsingContext::finished):
+
2010-09-01 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Darin Adler.
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index ef62b38..064d4e5 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -72,6 +72,23 @@ void ContainerNode::removeAllChildren()
removeAllChildrenInContainer<Node, ContainerNode>(this);
}
+
+void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
+{
+ NodeVector children;
+ for (Node* child = oldParent->firstChild(); child; child = child->nextSibling())
+ children.append(child);
+ oldParent->removeAllChildren();
+
+ for (unsigned i = 0; i < children.size(); ++i) {
+ ExceptionCode ec = 0;
+ // FIXME: We need a no mutation event version of adoptNode.
+ RefPtr<Node> child = document()->adoptNode(children[i].release(), ec);
+ ASSERT(!ec);
+ parserAddChild(child.release());
+ }
+}
+
ContainerNode::~ContainerNode()
{
removeAllChildren();
diff --git a/WebCore/dom/ContainerNode.h b/WebCore/dom/ContainerNode.h
index ad0a54a..ab90783 100644
--- a/WebCore/dom/ContainerNode.h
+++ b/WebCore/dom/ContainerNode.h
@@ -75,6 +75,7 @@ public:
virtual bool removeChildren();
void removeAllChildren();
+ void takeAllChildrenFrom(ContainerNode*);
void cloneChildNodes(ContainerNode* clone);
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index fe912de..8c76fc0 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -241,16 +241,6 @@ HTMLFormElement* closestFormAncestor(Element* element)
return 0;
}
-// FIXME: This belongs on ContainerNode, where it could avoid the double ref
-// by directly releasing into the Vector. Such an implementation would need to
-// be careful not to send mutation events.
-void takeChildrenFromNode(ContainerNode* container, Vector<RefPtr<Node> >& children)
-{
- for (Node* child = container->firstChild(); child; child = child->nextSibling())
- children.append(child);
- container->removeAllChildren();
-}
-
} // namespace
class HTMLTreeBuilder::ExternalCharacterTokenBuffer : public Noncopyable {
@@ -432,15 +422,7 @@ void HTMLTreeBuilder::FragmentParsingContext::finished()
ContainerNode* root = m_dummyDocumentForFragmentParsing.get();
if (m_contextElement)
root = m_dummyDocumentForFragmentParsing->documentElement();
- Vector<RefPtr<Node> > children;
- takeChildrenFromNode(root, children);
- for (unsigned i = 0; i < children.size(); ++i) {
- ExceptionCode ec = 0;
- // FIXME: We need a parser-safe (no events) version of adoptNode.
- RefPtr<Node> child = m_fragment->document()->adoptNode(children[i].release(), ec);
- ASSERT(!ec);
- m_fragment->parserAddChild(child.release());
- }
+ m_fragment->takeAllChildrenFrom(root);
}
HTMLTreeBuilder::FragmentParsingContext::~FragmentParsingContext()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list