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

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

Issue 177613003: Consistently cache ElementData::length() before loops (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test failure Created 6 years, 10 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/page/PageSerializer.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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 if (n && n->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { / / In XPath land, namespace nodes are not accessible on the attribute axis. 343 if (n && n->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { / / In XPath land, namespace nodes are not accessible on the attribute axis.
344 if (nodeMatches(n.get(), AttributeAxis, m_nodeTest)) // Stil l need to check merged predicates. 344 if (nodeMatches(n.get(), AttributeAxis, m_nodeTest)) // Stil l need to check merged predicates.
345 nodes.append(n.release()); 345 nodes.append(n.release());
346 } 346 }
347 return; 347 return;
348 } 348 }
349 349
350 if (!contextElement->hasAttributes()) 350 if (!contextElement->hasAttributes())
351 return; 351 return;
352 352
353 for (unsigned i = 0; i < contextElement->attributeCount(); ++i) { 353 unsigned attributeCount = contextElement->attributeCount();
354 for (unsigned i = 0; i < attributeCount; ++i) {
354 RefPtr<Attr> attr = contextElement->ensureAttr(contextElement->a ttributeItem(i)->name()); 355 RefPtr<Attr> attr = contextElement->ensureAttr(contextElement->a ttributeItem(i)->name());
355 if (nodeMatches(attr.get(), AttributeAxis, m_nodeTest)) 356 if (nodeMatches(attr.get(), AttributeAxis, m_nodeTest))
356 nodes.append(attr.release()); 357 nodes.append(attr.release());
357 } 358 }
358 return; 359 return;
359 } 360 }
360 case NamespaceAxis: 361 case NamespaceAxis:
361 // XPath namespace nodes are not implemented. 362 // XPath namespace nodes are not implemented.
362 return; 363 return;
363 case SelfAxis: 364 case SelfAxis:
(...skipping 26 matching lines...) Expand all
390 nodes.markSorted(false); 391 nodes.markSorted(false);
391 return; 392 return;
392 } 393 }
393 } 394 }
394 ASSERT_NOT_REACHED(); 395 ASSERT_NOT_REACHED();
395 } 396 }
396 397
397 398
398 } 399 }
399 } 400 }
OLDNEW
« no previous file with comments | « Source/core/page/PageSerializer.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698