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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCollection.cpp

Issue 2470233009: WTF/std normalization: replace WTF::Vector::first() with ::front() (Closed)
Patch Set: rebase Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003-2008, 2011, 2012, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2003-2008, 2011, 2012, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 5 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem .asp 406 // http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem .asp
407 // This method first searches for an object with a matching id 407 // This method first searches for an object with a matching id
408 // attribute. If a match is not found, the method then searches for an 408 // attribute. If a match is not found, the method then searches for an
409 // object with a matching name attribute, but only on those elements 409 // object with a matching name attribute, but only on those elements
410 // that are allowed a name attribute. 410 // that are allowed a name attribute.
411 updateIdNameCache(); 411 updateIdNameCache();
412 412
413 const NamedItemCache& cache = namedItemCache(); 413 const NamedItemCache& cache = namedItemCache();
414 HeapVector<Member<Element>>* idResults = cache.getElementsById(name); 414 HeapVector<Member<Element>>* idResults = cache.getElementsById(name);
415 if (idResults && !idResults->isEmpty()) 415 if (idResults && !idResults->isEmpty())
416 return idResults->first(); 416 return idResults->front();
417 417
418 HeapVector<Member<Element>>* nameResults = cache.getElementsByName(name); 418 HeapVector<Member<Element>>* nameResults = cache.getElementsByName(name);
419 if (nameResults && !nameResults->isEmpty()) 419 if (nameResults && !nameResults->isEmpty())
420 return nameResults->first(); 420 return nameResults->front();
421 421
422 return nullptr; 422 return nullptr;
423 } 423 }
424 424
425 bool HTMLCollection::namedPropertyQuery(const AtomicString& name, 425 bool HTMLCollection::namedPropertyQuery(const AtomicString& name,
426 ExceptionState&) { 426 ExceptionState&) {
427 return namedItem(name); 427 return namedItem(name);
428 } 428 }
429 429
430 void HTMLCollection::supportedPropertyNames(Vector<String>& names) { 430 void HTMLCollection::supportedPropertyNames(Vector<String>& names) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 HTMLCollection::NamedItemCache::NamedItemCache() {} 517 HTMLCollection::NamedItemCache::NamedItemCache() {}
518 518
519 DEFINE_TRACE(HTMLCollection) { 519 DEFINE_TRACE(HTMLCollection) {
520 visitor->trace(m_namedItemCache); 520 visitor->trace(m_namedItemCache);
521 visitor->trace(m_collectionItemsCache); 521 visitor->trace(m_collectionItemsCache);
522 LiveNodeListBase::trace(visitor); 522 LiveNodeListBase::trace(visitor);
523 } 523 }
524 524
525 } // namespace blink 525 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698