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

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

Issue 2583233002: Migrate WTF::Vector::append() to ::push_back() [part 7 of N] (Closed)
Patch Set: 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) 2006, 2011, 2012 Apple Computer, Inc. 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 HashSet<AtomicString> existingNames; 48 HashSet<AtomicString> existingNames;
49 unsigned length = this->length(); 49 unsigned length = this->length();
50 for (unsigned i = 0; i < length; ++i) { 50 for (unsigned i = 0; i < length; ++i) {
51 Element* element = item(i); 51 Element* element = item(i);
52 DCHECK(element); 52 DCHECK(element);
53 const AtomicString& idAttribute = element->getIdAttribute(); 53 const AtomicString& idAttribute = element->getIdAttribute();
54 if (!idAttribute.isEmpty()) { 54 if (!idAttribute.isEmpty()) {
55 HashSet<AtomicString>::AddResult addResult = 55 HashSet<AtomicString>::AddResult addResult =
56 existingNames.add(idAttribute); 56 existingNames.add(idAttribute);
57 if (addResult.isNewEntry) 57 if (addResult.isNewEntry)
58 names.append(idAttribute); 58 names.push_back(idAttribute);
59 } 59 }
60 const AtomicString& nameAttribute = element->getNameAttribute(); 60 const AtomicString& nameAttribute = element->getNameAttribute();
61 if (!nameAttribute.isEmpty()) { 61 if (!nameAttribute.isEmpty()) {
62 HashSet<AtomicString>::AddResult addResult = 62 HashSet<AtomicString>::AddResult addResult =
63 existingNames.add(nameAttribute); 63 existingNames.add(nameAttribute);
64 if (addResult.isNewEntry) 64 if (addResult.isNewEntry)
65 names.append(nameAttribute); 65 names.push_back(nameAttribute);
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 HTMLOptionsCollection* HTMLOptionsCollection::create(ContainerNode& select, 70 HTMLOptionsCollection* HTMLOptionsCollection::create(ContainerNode& select,
71 CollectionType) { 71 CollectionType) {
72 return new HTMLOptionsCollection(select); 72 return new HTMLOptionsCollection(select);
73 } 73 }
74 74
75 void HTMLOptionsCollection::add( 75 void HTMLOptionsCollection::add(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); 121 HTMLSelectElement& base = toHTMLSelectElement(ownerNode());
122 if (!value) { // undefined or null 122 if (!value) { // undefined or null
123 base.remove(index); 123 base.remove(index);
124 return true; 124 return true;
125 } 125 }
126 base.setOption(index, value, exceptionState); 126 base.setOption(index, value, exceptionState);
127 return true; 127 return true;
128 } 128 }
129 129
130 } // namespace blink 130 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLObjectElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698