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

Unified Diff: Source/core/dom/Node.cpp

Issue 1175173002: Simplify inDetach() assert and make it stronger. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 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 | « Source/core/dom/Node.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 84963b9521a0c1034a43e6ef82b92498e61d62b8..fe8bea14b96edab82f97e0c2fa1831ae165b0c19 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -931,39 +931,17 @@ void Node::attach(const AttachContext&)
cache->updateCacheAfterNodeIsAttached(this);
}
-#if ENABLE(ASSERT)
-static Node* detachingNode;
-
-bool Node::inDetach() const
-{
- return detachingNode == this;
-}
-#endif
-
void Node::detach(const AttachContext& context)
{
ASSERT(document().lifecycle().stateAllowsDetach());
DocumentLifecycle::DetachScope willDetach(document().lifecycle());
-#if ENABLE(ASSERT)
- // The detaching might trigger destruction of a popup menu window,
- // with ensuing detachment of its Nodes. In a separate document, so
- // don't assert for these, but do set detachingNode to the most recent
- // Node being detached.
- ASSERT(!detachingNode || detachingNode->document() != document());
- detachingNode = this;
-#endif
-
if (layoutObject())
layoutObject()->destroyAndCleanupAnonymousWrappers();
setLayoutObject(nullptr);
setStyleChange(NeedsReattachStyleChange);
clearChildNeedsStyleInvalidation();
-
-#if ENABLE(ASSERT)
- detachingNode = nullptr;
-#endif
}
void Node::reattachWhitespaceSiblingsIfNeeded(Text* start)
« no previous file with comments | « Source/core/dom/Node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698