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

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

Issue 1870583002: Update the behavior of ShadowRoot.activeElement to match the latest spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 4 years, 8 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 return false; 836 return false;
837 837
838 for (; node; node = node->shadowHost()) { 838 for (; node; node = node->shadowHost()) {
839 if (treeScope() == node->treeScope()) 839 if (treeScope() == node->treeScope())
840 return contains(node); 840 return contains(node);
841 } 841 }
842 842
843 return false; 843 return false;
844 } 844 }
845 845
846 Node* Node::retarget(const Node& target) const
847 {
848 for (const Node* ancestor = ⌖ ancestor; ancestor = ancestor->shadowHo st()) {
849 if (treeScope() == ancestor->treeScope())
850 return const_cast<Node*>(ancestor);
851 }
852 return nullptr;
853 }
854
846 bool Node::containsIncludingHostElements(const Node& node) const 855 bool Node::containsIncludingHostElements(const Node& node) const
847 { 856 {
848 const Node* current = &node; 857 const Node* current = &node;
849 do { 858 do {
850 if (current == this) 859 if (current == this)
851 return true; 860 return true;
852 if (current->isDocumentFragment() && toDocumentFragment(current)->isTemp lateContent()) 861 if (current->isDocumentFragment() && toDocumentFragment(current)->isTemp lateContent())
853 current = static_cast<const TemplateContentDocumentFragment*>(curren t)->host(); 862 current = static_cast<const TemplateContentDocumentFragment*>(curren t)->host();
854 else 863 else
855 current = current->parentOrShadowHostNode(); 864 current = current->parentOrShadowHostNode();
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 2456
2448 void showNodePath(const blink::Node* node) 2457 void showNodePath(const blink::Node* node)
2449 { 2458 {
2450 if (node) 2459 if (node)
2451 node->showNodePathForThis(); 2460 node->showNodePathForThis();
2452 else 2461 else
2453 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2462 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2454 } 2463 }
2455 2464
2456 #endif 2465 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698