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

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 (fixed test that was expected to fail and is now passing) 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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeRenderingContext.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 26f66f0f2537c5736b89b1b643ad40ef6f03beae..1bfea1deff84adf534275989696b3aae7a2be186 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1087,7 +1087,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())));
@@ -1130,7 +1130,7 @@ bool Node::inDetach() const
}
#endif
-void Node::detach()
+void Node::detach(const AttachContext& context)
{
#ifndef NDEBUG
ASSERT(!detachingNode);
@@ -1141,13 +1141,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);
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeRenderingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698