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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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/XPathStep.cpp ('k') | Source/web/WebFrameImpl.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. 3 * Copyright (C) 2006, 2009 Apple Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 case Node::COMMENT_NODE: 47 case Node::COMMENT_NODE:
48 case Node::TEXT_NODE: 48 case Node::TEXT_NODE:
49 case Node::CDATA_SECTION_NODE: 49 case Node::CDATA_SECTION_NODE:
50 case Node::XPATH_NAMESPACE_NODE: 50 case Node::XPATH_NAMESPACE_NODE:
51 return node->nodeValue(); 51 return node->nodeValue();
52 default: 52 default:
53 if (isRootDomNode(node) || node->nodeType() == Node::ELEMENT_NODE) { 53 if (isRootDomNode(node) || node->nodeType() == Node::ELEMENT_NODE) {
54 StringBuilder result; 54 StringBuilder result;
55 result.reserveCapacity(1024); 55 result.reserveCapacity(1024);
56 56
57 for (Node* n = node->firstChild(); n; n = NodeTraversal::next(n, node)) { 57 for (Node* n = node->firstChild(); n; n = NodeTraversal::next(*n , node)) {
58 if (n->isTextNode()) { 58 if (n->isTextNode()) {
59 const String& nodeValue = n->nodeValue(); 59 const String& nodeValue = n->nodeValue();
60 result.append(nodeValue); 60 result.append(nodeValue);
61 } 61 }
62 } 62 }
63 63
64 return result.toString(); 64 return result.toString();
65 } 65 }
66 } 66 }
67 67
(...skipping 20 matching lines...) Expand all
88 return false; 88 return false;
89 case Node::TEXT_NODE: 89 case Node::TEXT_NODE:
90 return !(node->parentNode() && node->parentNode()->isAttributeNode() ); 90 return !(node->parentNode() && node->parentNode()->isAttributeNode() );
91 } 91 }
92 ASSERT_NOT_REACHED(); 92 ASSERT_NOT_REACHED();
93 return false; 93 return false;
94 } 94 }
95 95
96 } 96 }
97 } 97 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathStep.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698