Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: Source/core/dom/ContainerNode.h

Issue 305603003: Merge ChildNodeInsertionNotifier and ChildNodeRemovalNotifier into ContainerNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't mess with RefPtr protects yet Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index b7bd10c9420b3a22881f056b7b92f4023f546475..3e3a8dd48b9a17e142bf4e11bd002bce4ef922db 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -113,6 +113,12 @@ enum DynamicRestyleFlags {
NumberOfDynamicRestyleFlags = 10,
};
+// This constant controls how much buffer is initially allocated
+// for a Node Vector that is used to store child Nodes of a given Node.
+// FIXME: Optimize the value.
+const int initialNodeVectorSize = 11;
+typedef Vector<RefPtr<Node>, initialNodeVectorSize> NodeVector;
+
class ContainerNode : public Node {
public:
virtual ~ContainerNode();
@@ -214,6 +220,9 @@ public:
virtual void trace(Visitor*) OVERRIDE;
+ void notifyNodeInserted(Node&);
+ void notifyNodeRemoved(Node&);
+
protected:
ContainerNode(TreeScope*, ConstructionType = CreateContainer);
@@ -237,6 +246,8 @@ private:
void willRemoveChildren();
void willRemoveChild(Node& child);
+ void notifyNodeInsertedInternal(Node&, NodeVector& postInsertionNotificationTargets);
+
bool hasRestyleFlag(DynamicRestyleFlags mask) const { return hasRareData() && hasRestyleFlagInternal(mask); }
bool hasRestyleFlags() const { return hasRareData() && hasRestyleFlagsInternal(); }
void setRestyleFlag(DynamicRestyleFlags);
@@ -351,12 +362,6 @@ inline ContainerNode* Node::parentElementOrDocumentFragment() const
return parent && (parent->isElementNode() || parent->isDocumentFragment()) ? parent : 0;
}
-// This constant controls how much buffer is initially allocated
-// for a Node Vector that is used to store child Nodes of a given Node.
-// FIXME: Optimize the value.
-const int initialNodeVectorSize = 11;
-typedef Vector<RefPtr<Node>, initialNodeVectorSize> NodeVector;
-
inline void getChildNodes(Node& node, NodeVector& nodes)
{
ASSERT(!nodes.size());
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698