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

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

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/Element.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index abe29ca333e16795f08b87a40a7d34bf77c38ba8..c13783f933cd4da5d294e512afe969c3a4efcff9 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -534,20 +534,27 @@ public:
RenderBox* renderBox() const;
RenderBoxModelObject* renderBoxModelObject() const;
+ struct AttachContext {
+ RenderStyle* resolvedStyle;
+ bool performingReattach;
+
+ AttachContext() : resolvedStyle(0), performingReattach(false) { }
+ };
+
// Attaches this node to the rendering tree. This calculates the style to be applied to the node and creates an
// appropriate RenderObject which will be inserted into the tree (except when the style has display: none). This
// makes the node visible in the FrameView.
- virtual void attach();
+ virtual void attach(const AttachContext& = AttachContext());
// Detaches the node from the rendering tree, making it invisible in the rendered view. This method will remove
// the node's rendering object from the rendering tree and delete it.
- virtual void detach();
+ virtual void detach(const AttachContext& = AttachContext());
#ifndef NDEBUG
bool inDetach() const;
#endif
- void reattach();
+ void reattach(const AttachContext& = AttachContext());
void lazyReattachIfAttached();
ContainerNode* parentNodeForRenderingAndStyle();
@@ -886,11 +893,14 @@ inline ContainerNode* Node::parentNodeGuaranteedHostFree() const
return parentOrShadowHostNode();
}
-inline void Node::reattach()
+inline void Node::reattach(const AttachContext& context)
{
+ AttachContext reattachContext(context);
+ reattachContext.performingReattach = true;
+
if (attached())
- detach();
- attach();
+ detach(reattachContext);
+ attach(reattachContext);
}
inline void Node::lazyReattachIfAttached()
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698