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

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

Issue 1173283002: Move some Element specific code from Node::detach to Element::detach. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/Element.cpp ('k') | Source/core/dom/UserActionElementSet.h » ('j') | 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 aa67a5ea3fc523d3fff4d823531b89ee4e66fac3..84963b9521a0c1034a43e6ef82b92498e61d62b8 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -698,6 +698,7 @@ void Node::setIsLink(bool isLink)
void Node::setNeedsStyleInvalidation()
{
+ ASSERT(isElementNode());
setFlag(NeedsStyleInvalidationFlag);
markAncestorsWithChildNeedsStyleInvalidation();
}
@@ -957,24 +958,8 @@ void Node::detach(const AttachContext& context)
layoutObject()->destroyAndCleanupAnonymousWrappers();
setLayoutObject(nullptr);
- // Do not remove the element's hovered and active status
- // if performing a reattach.
- if (!context.performingReattach) {
- Document& doc = document();
- if (isUserActionElement()) {
- if (hovered())
- doc.hoveredNodeDetached(this);
- if (inActiveChain())
- doc.activeChainNodeDetached(this);
- doc.userActionElements().didDetach(this);
- }
- }
-
setStyleChange(NeedsReattachStyleChange);
-
- document().styleEngine().styleInvalidator().clearInvalidation(*this);
clearChildNeedsStyleInvalidation();
- clearNeedsStyleInvalidation();
#if ENABLE(ASSERT)
detachingNode = nullptr;
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/UserActionElementSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698