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

Unified Diff: Source/core/dom/Element.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/Element.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index be02cb9d24c37f094f41a4db98c0ba3bfef57dc8..4b4c6413ee03f3893f8eb26abed04fb044d1470f 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1258,18 +1258,18 @@ void Element::removedFrom(ContainerNode* insertionPoint)
document()->accessSVGExtensions()->removeElementFromPendingResources(this);
}
-void Element::createRendererIfNeeded()
+void Element::createRendererIfNeeded(const AttachContext& context)
{
- NodeRenderingContext(this).createRendererForElementIfNeeded();
+ NodeRenderingContext(this, context).createRendererForElementIfNeeded();
}
-void Element::attach()
+void Element::attach(const AttachContext& context)
{
PostAttachCallbackDisabler callbackDisabler(this);
StyleResolverParentPusher parentPusher(this);
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
- createRendererIfNeeded();
+ createRendererIfNeeded(context);
if (parentElement() && parentElement()->isInCanvasSubtree())
setIsInCanvasSubtree(true);
@@ -1283,7 +1283,7 @@ void Element::attach()
} else if (firstChild())
parentPusher.push();
- ContainerNode::attach();
+ ContainerNode::attach(context);
createPseudoElementIfNeeded(AFTER);
@@ -1303,7 +1303,7 @@ void Element::unregisterNamedFlowContentNode()
document()->renderView()->flowThreadController()->unregisterNamedFlowContentNode(this);
}
-void Element::detach()
+void Element::detach(const AttachContext& context)
{
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
unregisterNamedFlowContentNode();
@@ -1321,7 +1321,7 @@ void Element::detach()
detachChildrenIfNeeded();
shadow->detach();
}
- ContainerNode::detach();
+ ContainerNode::detach(context);
}
bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle)
@@ -1405,8 +1405,10 @@ void Element::recalcStyle(StyleChange change)
localChange = Node::diff(currentStyle.get(), newStyle.get(), document());
}
if (localChange == Detach) {
- // FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along.
- reattach();
+ AttachContext reattachContext;
+ reattachContext.resolvedStyle = newStyle.get();
+ reattach(reattachContext);
+
// attach recalculates the style for all children. No need to do it twice.
clearNeedsStyleRecalc();
clearChildNeedsStyleRecalc();
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698