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

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

Issue 16599003: :hover style not applied on hover if its display property is different from original style's (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch Created 7 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
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 775c5e9c6b7aa73e3290e3aeb92a7b64ba32a130..6db1162e9fbe81ed4b5ad45a33cf8e7a53bfd63f 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1068,7 +1068,7 @@ bool Node::containsIncludingHostElements(const Node* node) const
return false;
}
-void Node::attach()
+void Node::attach(const AttachContext&)
{
ASSERT(!attached());
ASSERT(!renderer() || (renderer()->style() && (renderer()->parent() || renderer()->isRenderView())));
@@ -1111,7 +1111,7 @@ bool Node::inDetach() const
}
#endif
-void Node::detach()
+void Node::detach(const AttachContext& context)
{
#ifndef NDEBUG
ASSERT(!detachingNode);
@@ -1122,13 +1122,17 @@ void Node::detach()
renderer()->destroyAndCleanupAnonymousWrappers();
setRenderer(0);
- Document* doc = document();
- if (isUserActionElement()) {
- if (hovered())
- doc->hoveredNodeDetached(this);
- if (inActiveChain())
- doc->activeChainNodeDetached(this);
- doc->userActionElements().didDetach(this);
+ // 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);
+ }
}
clearFlag(IsAttachedFlag);

Powered by Google App Engine
This is Rietveld 408576698