Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 5ef85b8c99b269694a820145e9b53603cb2d594f..264fb8d500a66c80f374fcd3a16b246e6e5020b2 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -3425,6 +3425,10 @@ void Document::styleResolverMayHaveChanged() |
void Document::setHoverNode(PassRefPtrWillBeRawPtr<Node> newHoverNode) |
{ |
+ if (!newHoverNode) { |
+ m_hoverNode.clear(); |
Rick Byers
2014/11/17 22:00:10
why is this change necessary? Doesn't it already
|
+ return; |
+ } |
m_hoverNode = newHoverNode; |
} |
@@ -5424,10 +5428,21 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in |
} |
} |
- // Now set the hover state for our new object up to the root. |
- for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) { |
- if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain())) |
- nodesToAddToChain.append(curr->node()); |
+ if ((settings() && settings()->viewportEnabled()) |
Rick Byers
2014/11/17 22:00:10
The logic to decide when to apply this policy belo
|
+ && oldHoverObj == newHoverObj && request.touchEvent() && !request.active() && !request.hover()) { |
+ // clear the :hover style after Tap, when meta viewport is set |
+ for (RenderObject* curr = oldHoverObj; curr; curr = curr->hoverAncestor()) { |
Rick Byers
2014/11/17 22:00:10
please don't copy/paste code from above. We shoul
|
+ if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain())) { |
+ nodesToRemoveFromChain.append(curr->node()); |
+ } |
+ } |
+ setHoverNode(nullptr); |
+ } else { |
+ // Now set the hover state for our new object up to the root. |
+ for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) { |
+ if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain())) |
+ nodesToAddToChain.append(curr->node()); |
+ } |
} |
// mouseenter and mouseleave events do not bubble, so they are dispatched iff there is a capturing |