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

Side by Side Diff: third_party/WebKit/Source/core/xml/XPathNodeSet.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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) 2007 Alexey Proskuryakov <ap@webkit.org> 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 for (unsigned i = 0; i < nodeCount; ++i) 192 for (unsigned i = 0; i < nodeCount; ++i)
193 sortedNodes.append(parentMatrix[i][0]); 193 sortedNodes.append(parentMatrix[i][0]);
194 194
195 const_cast<HeapVector<Member<Node>>&>(m_nodes).swap(sortedNodes); 195 const_cast<HeapVector<Member<Node>>&>(m_nodes).swap(sortedNodes);
196 } 196 }
197 197
198 static Node* findRootNode(Node* node) 198 static Node* findRootNode(Node* node)
199 { 199 {
200 if (node->isAttributeNode()) 200 if (node->isAttributeNode())
201 node = toAttr(node)->ownerElement(); 201 node = toAttr(node)->ownerElement();
202 if (node->inShadowIncludingDocument()) { 202 if (node->isConnected()) {
203 node = &node->document(); 203 node = &node->document();
204 } else { 204 } else {
205 while (Node* parent = node->parentNode()) 205 while (Node* parent = node->parentNode())
206 node = parent; 206 node = parent;
207 } 207 }
208 return node; 208 return node;
209 } 209 }
210 210
211 void NodeSet::traversalSort() const 211 void NodeSet::traversalSort() const
212 { 212 {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 Node* NodeSet::anyNode() const 273 Node* NodeSet::anyNode() const
274 { 274 {
275 if (isEmpty()) 275 if (isEmpty())
276 return nullptr; 276 return nullptr;
277 277
278 return m_nodes.at(0).get(); 278 return m_nodes.at(0).get();
279 } 279 }
280 280
281 } // namespace XPath 281 } // namespace XPath
282 } // namespace blink 282 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp ('k') | third_party/WebKit/Source/core/xml/XPathPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698