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

Side by Side Diff: Source/core/xml/XPathPath.cpp

Issue 239703007: Rename Node::lastDescendant() / Node::highestAncestor() for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename highestAncestor() as well Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/PageConsoleAgent.cpp ('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) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. 3 * Copyright (C) 2006, 2009 Apple Inc.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // "A / by itself selects the root node of the document containing the conte xt node." 98 // "A / by itself selects the root node of the document containing the conte xt node."
99 // In the case of a tree that is detached from the document, we violate 99 // In the case of a tree that is detached from the document, we violate
100 // the spec and treat / as the root node of the detached tree. 100 // the spec and treat / as the root node of the detached tree.
101 // This is for compatibility with Firefox, and also seems like a more 101 // This is for compatibility with Firefox, and also seems like a more
102 // logical treatment of where you would expect the "root" to be. 102 // logical treatment of where you would expect the "root" to be.
103 Node* context = evaluationContext.node.get(); 103 Node* context = evaluationContext.node.get();
104 if (m_absolute && context->nodeType() != Node::DOCUMENT_NODE) { 104 if (m_absolute && context->nodeType() != Node::DOCUMENT_NODE) {
105 if (context->inDocument()) 105 if (context->inDocument())
106 context = context->ownerDocument(); 106 context = context->ownerDocument();
107 else 107 else
108 context = &context->highestAncestor(); 108 context = &context->highestAncestorOrSelf();
109 } 109 }
110 110
111 NodeSet nodes; 111 NodeSet nodes;
112 nodes.append(context); 112 nodes.append(context);
113 evaluate(nodes); 113 evaluate(nodes);
114 114
115 evaluationContext = backupContext; 115 evaluationContext = backupContext;
116 return Value(nodes, Value::adopt); 116 return Value(nodes, Value::adopt);
117 } 117 }
118 118
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 Value v = m_filter->evaluate(); 205 Value v = m_filter->evaluate();
206 206
207 NodeSet& nodes = v.modifiableNodeSet(); 207 NodeSet& nodes = v.modifiableNodeSet();
208 m_path->evaluate(nodes); 208 m_path->evaluate(nodes);
209 209
210 return v; 210 return v;
211 } 211 }
212 212
213 } 213 }
214 } 214 }
OLDNEW
« no previous file with comments | « Source/core/inspector/PageConsoleAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698