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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 313183004: The element under mouse should be in hover state even if its not inActiveChain. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/css/hover-active-drag-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5460 matching lines...) Expand 10 before | Expand all | Expand 10 after
5471 if (oldHoverNode && !oldHoverObj) { 5471 if (oldHoverNode && !oldHoverObj) {
5472 for (Node* node = oldHoverNode.get(); node; node = node->parentNode( )) { 5472 for (Node* node = oldHoverNode.get(); node; node = node->parentNode( )) {
5473 if (!mustBeInActiveChain || (node->isElementNode() && toElement( node)->inActiveChain())) 5473 if (!mustBeInActiveChain || (node->isElementNode() && toElement( node)->inActiveChain()))
5474 nodesToRemoveFromChain.append(node); 5474 nodesToRemoveFromChain.append(node);
5475 } 5475 }
5476 5476
5477 } 5477 }
5478 5478
5479 // The old hover path only needs to be cleared up to (and not including) the common ancestor; 5479 // The old hover path only needs to be cleared up to (and not including) the common ancestor;
5480 for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr = curr->hoverAncestor()) { 5480 for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr = curr->hoverAncestor()) {
5481 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr ->node()->inActiveChain())) 5481 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr ->node()->inActiveChain() || curr == oldHoverObj))
Rick Byers 2014/06/12 18:24:06 This doesn't look like the right fix to me. How d
5482 nodesToRemoveFromChain.append(curr->node()); 5482 nodesToRemoveFromChain.append(curr->node());
5483 } 5483 }
5484 } 5484 }
5485 5485
5486 // Now set the hover state for our new object up to the root. 5486 // Now set the hover state for our new object up to the root.
5487 for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) { 5487 for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) {
5488 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->no de()->inActiveChain())) 5488 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->no de()->inActiveChain() || curr == newHoverObj))
5489 nodesToAddToChain.append(curr->node()); 5489 nodesToAddToChain.append(curr->node());
5490 } 5490 }
5491 5491
5492 // mouseenter and mouseleave events do not bubble, so they are dispatched if f there is a capturing 5492 // mouseenter and mouseleave events do not bubble, so they are dispatched if f there is a capturing
5493 // event handler on an ancestor or a normal event handler on the element its elf. This special 5493 // event handler on an ancestor or a normal event handler on the element its elf. This special
5494 // handling is necessary to avoid O(n^2) capturing event handler checks. We' ll check the previously 5494 // handling is necessary to avoid O(n^2) capturing event handler checks. We' ll check the previously
5495 // hovered node's ancestor tree for 'mouseleave' handlers here, then check t he newly hovered node's 5495 // hovered node's ancestor tree for 'mouseleave' handlers here, then check t he newly hovered node's
5496 // ancestor tree for 'mouseenter' handlers after dispatching the 'mouseleave ' events (as the handler 5496 // ancestor tree for 'mouseenter' handlers after dispatching the 'mouseleave ' events (as the handler
5497 // for 'mouseleave' might set a capturing 'mouseenter' handler, odd as that might be). 5497 // for 'mouseleave' might set a capturing 'mouseenter' handler, odd as that might be).
5498 bool ancestorHasCapturingMouseleaveListener = false; 5498 bool ancestorHasCapturingMouseleaveListener = false;
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
5796 visitor->trace(m_timeline); 5796 visitor->trace(m_timeline);
5797 visitor->trace(m_compositorPendingAnimations); 5797 visitor->trace(m_compositorPendingAnimations);
5798 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5798 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5799 DocumentSupplementable::trace(visitor); 5799 DocumentSupplementable::trace(visitor);
5800 TreeScope::trace(visitor); 5800 TreeScope::trace(visitor);
5801 ContainerNode::trace(visitor); 5801 ContainerNode::trace(visitor);
5802 ExecutionContext::trace(visitor); 5802 ExecutionContext::trace(visitor);
5803 } 5803 }
5804 5804
5805 } // namespace WebCore 5805 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/hover-active-drag-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698