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

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

Issue 337753005: Make iterator for Element's attributes more lightweight (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Proper rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XPathNodeSet.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('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 (C) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // Still need to check merged predicates. 383 // Still need to check merged predicates.
384 if (nodeMatches(n.get(), AttributeAxis, nodeTest())) 384 if (nodeMatches(n.get(), AttributeAxis, nodeTest()))
385 nodes.append(n.release()); 385 nodes.append(n.release());
386 } 386 }
387 return; 387 return;
388 } 388 }
389 389
390 if (!contextElement->hasAttributes()) 390 if (!contextElement->hasAttributes())
391 return; 391 return;
392 392
393 AttributeIteratorAccessor attributes = contextElement->attributesIterato r(); 393 AttributeCollection attributes = contextElement->attributes();
394 AttributeConstIterator end = attributes.end(); 394 AttributeCollection::const_iterator end = attributes.end();
395 for (AttributeConstIterator it = attributes.begin(); it != end; ++it) { 395 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
396 RefPtrWillBeRawPtr<Attr> attr = contextElement->ensureAttr(it->name( )); 396 RefPtrWillBeRawPtr<Attr> attr = contextElement->ensureAttr(it->name( ));
397 if (nodeMatches(attr.get(), AttributeAxis, nodeTest())) 397 if (nodeMatches(attr.get(), AttributeAxis, nodeTest()))
398 nodes.append(attr.release()); 398 nodes.append(attr.release());
399 } 399 }
400 return; 400 return;
401 } 401 }
402 402
403 case NamespaceAxis: 403 case NamespaceAxis:
404 // XPath namespace nodes are not implemented. 404 // XPath namespace nodes are not implemented.
405 return; 405 return;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 nodes.markSorted(false); 438 nodes.markSorted(false);
439 return; 439 return;
440 } 440 }
441 } 441 }
442 ASSERT_NOT_REACHED(); 442 ASSERT_NOT_REACHED();
443 } 443 }
444 444
445 } 445 }
446 446
447 } 447 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathNodeSet.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698