OLD | NEW |
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 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5417 | 5417 |
5418 } | 5418 } |
5419 | 5419 |
5420 // The old hover path only needs to be cleared up to (and not including)
the common ancestor; | 5420 // The old hover path only needs to be cleared up to (and not including)
the common ancestor; |
5421 for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr =
curr->hoverAncestor()) { | 5421 for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr =
curr->hoverAncestor()) { |
5422 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr
->node()->inActiveChain())) | 5422 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr
->node()->inActiveChain())) |
5423 nodesToRemoveFromChain.append(curr->node()); | 5423 nodesToRemoveFromChain.append(curr->node()); |
5424 } | 5424 } |
5425 } | 5425 } |
5426 | 5426 |
5427 // Now set the hover state for our new object up to the root. | 5427 if (oldHoverObj == newHoverObj && request.leave()) { |
5428 for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) { | 5428 // clear hover path upto including the ancestor |
5429 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->no
de()->inActiveChain())) | 5429 for (RenderObject* curr = oldHoverObj; curr; curr = curr->hoverAncestor(
)) { |
5430 nodesToAddToChain.append(curr->node()); | 5430 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr
->node()->inActiveChain())) { |
| 5431 nodesToRemoveFromChain.append(curr->node()); |
| 5432 } |
| 5433 } |
| 5434 setHoverNode(nullptr); |
| 5435 } else { |
| 5436 // Now set the hover state for our new object up to the root. |
| 5437 for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor(
)) { |
| 5438 if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr
->node()->inActiveChain())) |
| 5439 nodesToAddToChain.append(curr->node()); |
| 5440 } |
5431 } | 5441 } |
5432 | 5442 |
5433 // mouseenter and mouseleave events do not bubble, so they are dispatched if
f there is a capturing | 5443 // mouseenter and mouseleave events do not bubble, so they are dispatched if
f there is a capturing |
5434 // event handler on an ancestor or a normal event handler on the element its
elf. This special | 5444 // event handler on an ancestor or a normal event handler on the element its
elf. This special |
5435 // handling is necessary to avoid O(n^2) capturing event handler checks. We'
ll check the previously | 5445 // handling is necessary to avoid O(n^2) capturing event handler checks. We'
ll check the previously |
5436 // hovered node's ancestor tree for 'mouseleave' handlers here, then check t
he newly hovered node's | 5446 // hovered node's ancestor tree for 'mouseleave' handlers here, then check t
he newly hovered node's |
5437 // ancestor tree for 'mouseenter' handlers after dispatching the 'mouseleave
' events (as the handler | 5447 // ancestor tree for 'mouseenter' handlers after dispatching the 'mouseleave
' events (as the handler |
5438 // for 'mouseleave' might set a capturing 'mouseenter' handler, odd as that
might be). | 5448 // for 'mouseleave' might set a capturing 'mouseenter' handler, odd as that
might be). |
5439 bool ancestorHasCapturingMouseleaveListener = false; | 5449 bool ancestorHasCapturingMouseleaveListener = false; |
5440 if (event && newHoverNode != oldHoverNode.get()) { | 5450 if (event && newHoverNode != oldHoverNode.get()) { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5848 #ifndef NDEBUG | 5858 #ifndef NDEBUG |
5849 using namespace blink; | 5859 using namespace blink; |
5850 void showLiveDocumentInstances() | 5860 void showLiveDocumentInstances() |
5851 { | 5861 { |
5852 WeakDocumentSet& set = liveDocumentSet(); | 5862 WeakDocumentSet& set = liveDocumentSet(); |
5853 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5863 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5854 for (Document* document : set) | 5864 for (Document* document : set) |
5855 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5865 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5856 } | 5866 } |
5857 #endif | 5867 #endif |
OLD | NEW |