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

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

Issue 317733004: Update an Element's ancestor chain at the end of its activation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review Comments 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/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.png ('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 5437 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « LayoutTests/platform/linux/fast/spatial-navigation/snav-multiple-select-focusring-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698