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

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

Issue 968293002: Fix template angle bracket syntax in xml (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « Source/core/xml/XPathPath.cpp ('k') | Source/core/xml/XPathStep.h » ('j') | 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 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 Value Union::evaluate(EvaluationContext& context) const 252 Value Union::evaluate(EvaluationContext& context) const
253 { 253 {
254 Value lhsResult = subExpr(0)->evaluate(context); 254 Value lhsResult = subExpr(0)->evaluate(context);
255 Value rhs = subExpr(1)->evaluate(context); 255 Value rhs = subExpr(1)->evaluate(context);
256 256
257 NodeSet& resultSet = lhsResult.modifiableNodeSet(context); 257 NodeSet& resultSet = lhsResult.modifiableNodeSet(context);
258 const NodeSet& rhsNodes = rhs.toNodeSet(&context); 258 const NodeSet& rhsNodes = rhs.toNodeSet(&context);
259 259
260 WillBeHeapHashSet<RawPtrWillBeMember<Node> > nodes; 260 WillBeHeapHashSet<RawPtrWillBeMember<Node>> nodes;
261 for (size_t i = 0; i < resultSet.size(); ++i) 261 for (size_t i = 0; i < resultSet.size(); ++i)
262 nodes.add(resultSet[i]); 262 nodes.add(resultSet[i]);
263 263
264 for (size_t i = 0; i < rhsNodes.size(); ++i) { 264 for (size_t i = 0; i < rhsNodes.size(); ++i) {
265 Node* node = rhsNodes[i]; 265 Node* node = rhsNodes[i];
266 if (nodes.add(node).isNewEntry) 266 if (nodes.add(node).isNewEntry)
267 resultSet.append(node); 267 resultSet.append(node);
268 } 268 }
269 269
270 // It is also possible to use merge sort to avoid making the result 270 // It is also possible to use merge sort to avoid making the result
(...skipping 23 matching lines...) Expand all
294 294
295 // foo[3] means foo[position()=3] 295 // foo[3] means foo[position()=3]
296 if (result.isNumber()) 296 if (result.isNumber())
297 return EqTestOp(EqTestOp::OpcodeEqual, adoptPtrWillBeNoop(createFunction ("position")), adoptPtrWillBeNoop(new Number(result.toNumber()))).evaluate(conte xt).toBoolean(); 297 return EqTestOp(EqTestOp::OpcodeEqual, adoptPtrWillBeNoop(createFunction ("position")), adoptPtrWillBeNoop(new Number(result.toNumber()))).evaluate(conte xt).toBoolean();
298 298
299 return result.toBoolean(); 299 return result.toBoolean();
300 } 300 }
301 301
302 } 302 }
303 } 303 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathPath.cpp ('k') | Source/core/xml/XPathStep.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698