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 5437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5448 Element* oldActiveElement = activeHoverElement(); | 5448 Element* oldActiveElement = activeHoverElement(); |
5449 if (oldActiveElement && !request.active()) { | 5449 if (oldActiveElement && !request.active()) { |
5450 // We are clearing the :active chain because the mouse has been released . | 5450 // We are clearing the :active chain because the mouse has been released . |
5451 for (RenderObject* curr = oldActiveElement->renderer(); curr; curr = cur r->parent()) { | 5451 for (RenderObject* curr = oldActiveElement->renderer(); curr; curr = cur r->parent()) { |
5452 if (curr->node()) { | 5452 if (curr->node()) { |
5453 ASSERT(!curr->node()->isTextNode()); | 5453 ASSERT(!curr->node()->isTextNode()); |
5454 curr->node()->setActive(false); | 5454 curr->node()->setActive(false); |
5455 m_userActionElements.setInActiveChain(curr->node(), false); | 5455 m_userActionElements.setInActiveChain(curr->node(), false); |
5456 } | 5456 } |
5457 } | 5457 } |
5458 // The oldActiveElement renderer is null, dropped on :active by setting display: none, | |
5459 // for instance. We still need to clear the ActiveChain as the mouse is released. | |
5460 if (!oldActiveElement->renderer()) { | |
5461 for (Node* node = oldActiveElement; node; node = node->parentNode()) { | |
esprehn
2014/06/17 08:37:20
This is not correct for Shadow DOM. You need to us
spartha
2014/06/17 15:07:00
I tried this content http://jsbin.com/fasoyuqi on
spartha
2014/06/18 12:40:09
I have uploaded a patch using NodeRenderingTravers
| |
5462 node->setActive(false); | |
5463 m_userActionElements.setInActiveChain(node, false); | |
5464 } | |
5465 } | |
5458 setActiveHoverElement(nullptr); | 5466 setActiveHoverElement(nullptr); |
5459 } else { | 5467 } else { |
5460 Element* newActiveElement = innerElementInDocument; | 5468 Element* newActiveElement = innerElementInDocument; |
5461 if (!oldActiveElement && newActiveElement && request.active() && !reques t.touchMove()) { | 5469 if (!oldActiveElement && newActiveElement && request.active() && !reques t.touchMove()) { |
5462 // We are setting the :active chain and freezing it. If future moves happen, they | 5470 // We are setting the :active chain and freezing it. If future moves happen, they |
5463 // will need to reference this chain. | 5471 // will need to reference this chain. |
5464 for (RenderObject* curr = newActiveElement->renderer(); curr; curr = curr->parent()) { | 5472 for (RenderObject* curr = newActiveElement->renderer(); curr; curr = curr->parent()) { |
5465 if (curr->node() && !curr->isText()) | 5473 if (curr->node() && !curr->isText()) |
5466 m_userActionElements.setInActiveChain(curr->node(), true); | 5474 m_userActionElements.setInActiveChain(curr->node(), true); |
5467 } | 5475 } |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5838 visitor->trace(m_compositorPendingAnimations); | 5846 visitor->trace(m_compositorPendingAnimations); |
5839 visitor->trace(m_contextDocument); | 5847 visitor->trace(m_contextDocument); |
5840 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); | 5848 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); |
5841 DocumentSupplementable::trace(visitor); | 5849 DocumentSupplementable::trace(visitor); |
5842 TreeScope::trace(visitor); | 5850 TreeScope::trace(visitor); |
5843 ContainerNode::trace(visitor); | 5851 ContainerNode::trace(visitor); |
5844 ExecutionContext::trace(visitor); | 5852 ExecutionContext::trace(visitor); |
5845 } | 5853 } |
5846 | 5854 |
5847 } // namespace WebCore | 5855 } // namespace WebCore |
OLD | NEW |