Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 7478467e2dd5fbee14ea4346e4c1a15c206cd01f..312b79894954f1505710b25de7b6259839fa0a43 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -1762,6 +1762,12 @@ void Document::recalcStyle(StyleChange change) |
} |
InspectorInstrumentation::didRecalculateStyle(cookie); |
+ |
+ // As a result of the style recalculation, the currently hovered element might have been |
+ // detached (for example, by setting display:none in the :hover style), schedule another mouseMove event |
+ // to check if any other elements ended up under the mouse pointer due to re-layout. |
+ if (hoverNode() && !hoverNode()->renderer() && frame()) |
+ frame()->eventHandler()->dispatchFakeMouseMoveEventSoon(); |
ojan
2013/06/23 17:58:11
To my surprised, firing the fake mouse move events
|
} |
void Document::updateStyleIfNeeded() |
@@ -5053,11 +5059,14 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in |
if (oldHoverObj != newHoverObj) { |
// If the old hovered node is not nil but it's renderer is, it was probably detached as part of the :hover style |
- // (for instance by setting display:none in the :hover pseudo-class). In this case, the old hovered element |
+ // (for instance by setting display:none in the :hover pseudo-class). In this case, the old hovered element (and its ancestors) |
// must be updated, to ensure it's normal style is re-applied. |
if (oldHoverNode && !oldHoverObj) { |
- if (!mustBeInActiveChain || oldHoverNode->inActiveChain()) |
- nodesToRemoveFromChain.append(oldHoverNode); |
+ for (Node* node = oldHoverNode.get(); node; node = node->parentNode()) { |
+ if (!mustBeInActiveChain || (node->isElementNode() && toElement(node)->inActiveChain())) |
+ nodesToRemoveFromChain.append(node); |
+ } |
+ |
} |
// The old hover path only needs to be cleared up to (and not including) the common ancestor; |