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

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

Issue 323253002: Remove NodeRemovalDispatcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNodeAlgorithms.h
diff --git a/Source/core/dom/ContainerNodeAlgorithms.h b/Source/core/dom/ContainerNodeAlgorithms.h
index c6014f3598e04f325a85d8f7fc341f110ff34a58..a8094a3c1426d3cd1bd5826dcc62f71f4933b7fc 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.h
+++ b/Source/core/dom/ContainerNodeAlgorithms.h
@@ -85,34 +85,6 @@ inline void appendChildToContainer(GenericNode& child, GenericNodeContainer& con
// Helper methods for removeDetachedChildrenInContainer, hidden from WebCore namespace
namespace Private {
- template<class GenericNode, class GenericNodeContainer, bool dispatchRemovalNotification>
- struct NodeRemovalDispatcher {
- static void dispatch(GenericNode&, GenericNodeContainer&)
- {
- // no-op, by default
- }
- };
-
- template<class GenericNode, class GenericNodeContainer>
- struct NodeRemovalDispatcher<GenericNode, GenericNodeContainer, true> {
- static void dispatch(GenericNode& node, GenericNodeContainer& container)
- {
- container.document().adoptIfNeeded(node);
- if (node.inDocument())
- container.notifyNodeRemoved(node);
- }
- };
-
- template<class GenericNode>
- struct ShouldDispatchRemovalNotification {
- static const bool value = false;
- };
-
- template<>
- struct ShouldDispatchRemovalNotification<Node> {
- static const bool value = true;
- };
-
template<class GenericNode, class GenericNodeContainer>
void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer& container)
{
@@ -142,7 +114,9 @@ namespace Private {
tail = n;
} else {
RefPtrWillBeRawPtr<GenericNode> protect(n); // removedFromDocument may remove all references to this node.
- NodeRemovalDispatcher<GenericNode, GenericNodeContainer, ShouldDispatchRemovalNotification<GenericNode>::value>::dispatch(*n, container);
+ container.document().adoptIfNeeded(*n);
+ if (n->inDocument())
+ container.notifyNodeRemoved(*n);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698