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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up some tests Created 4 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
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 { 763 {
764 DCHECK(focused()); 764 DCHECK(focused());
765 return true; 765 return true;
766 } 766 }
767 767
768 bool Node::isInert() const 768 bool Node::isInert() const
769 { 769 {
770 const HTMLDialogElement* dialog = document().activeModalDialog(); 770 const HTMLDialogElement* dialog = document().activeModalDialog();
771 if (dialog && this != document() && (!canParticipateInFlatTree() || !FlatTre eTraversal::containsIncludingPseudoElement(*dialog, *this))) 771 if (dialog && this != document() && (!canParticipateInFlatTree() || !FlatTre eTraversal::containsIncludingPseudoElement(*dialog, *this)))
772 return true; 772 return true;
773
774 if (RuntimeEnabledFeatures::inertAttributeEnabled()) {
775 const Node* n = this;
esprehn 2016/06/27 22:27:15 node, don't abbreviate
aboxhall 2016/06/29 00:13:12 Done.
776 do {
777 if (n->isElementNode() && toElement(n)->hasAttribute(HTMLNames::iner tAttr))
esprehn 2016/06/27 22:27:15 I think you want instead use node.parentOrShadowHo
aboxhall 2016/06/27 23:59:22 Where do I want to do that, sorry?
esprehn 2016/06/28 18:55:07 Your loop should be over parentOrShadowHostElement
aboxhall 2016/06/29 00:13:12 Done.
778 return true;
779 n = n->parentOrShadowHostNode();
780 } while (n);
781 }
782
773 return document().localOwner() && document().localOwner()->isInert(); 783 return document().localOwner() && document().localOwner()->isInert();
774 } 784 }
775 785
776 unsigned Node::nodeIndex() const 786 unsigned Node::nodeIndex() const
777 { 787 {
778 const Node* tempNode = previousSibling(); 788 const Node* tempNode = previousSibling();
779 unsigned count = 0; 789 unsigned count = 0;
780 for (count = 0; tempNode; count++) 790 for (count = 0; tempNode; count++)
781 tempNode = tempNode->previousSibling(); 791 tempNode = tempNode->previousSibling();
782 return count; 792 return count;
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 2493
2484 void showNodePath(const blink::Node* node) 2494 void showNodePath(const blink::Node* node)
2485 { 2495 {
2486 if (node) 2496 if (node)
2487 node->showNodePathForThis(); 2497 node->showNodePathForThis();
2488 else 2498 else
2489 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2499 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2490 } 2500 }
2491 2501
2492 #endif 2502 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698