Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 6f0e65b65d5f8070dafac6d173eb755a75ec4c26..309b3a9d8f1cfb7c9e201fe77cf56e0ee0e69e57 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -1772,6 +1772,12 @@ void Document::updateStyleIfNeeded() |
| AnimationUpdateBlock animationUpdateBlock(m_frame ? m_frame->animation() : 0); |
| recalcStyle(NoChange); |
| + |
| + // 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(); |
|
esprehn
2013/06/17 22:00:27
Hmm, there's a number of other places where we mig
stavila
2013/06/18 08:54:00
Yes, I know Document::recalcStyle is called in mul
|
| } |
| void Document::updateLayout() |
| @@ -5050,11 +5056,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; |