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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2653203003: Migrate WTF::Vector::append() to ::push_back() [part 17 of N] (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 attributeValue.split(' ', ids); 158 attributeValue.split(' ', ids);
159 if (ids.isEmpty()) 159 if (ids.isEmpty())
160 return; 160 return;
161 161
162 HeapVector<Member<AXObject>> objects; 162 HeapVector<Member<AXObject>> objects;
163 TreeScope& scope = node->treeScope(); 163 TreeScope& scope = node->treeScope();
164 for (const auto& id : ids) { 164 for (const auto& id : ids) {
165 if (Element* idElement = scope.getElementById(AtomicString(id))) { 165 if (Element* idElement = scope.getElementById(AtomicString(id))) {
166 AXObject* axIdElement = obj.axObjectCache().getOrCreate(idElement); 166 AXObject* axIdElement = obj.axObjectCache().getOrCreate(idElement);
167 if (axIdElement && !axIdElement->accessibilityIsIgnored()) 167 if (axIdElement && !axIdElement->accessibilityIsIgnored())
168 objects.append(axIdElement); 168 objects.push_back(axIdElement);
169 } 169 }
170 } 170 }
171 171
172 attributeMap.addObjectVectorAttribute(m_attribute, objects); 172 attributeMap.addObjectVectorAttribute(m_attribute, objects);
173 } 173 }
174 }; 174 };
175 175
176 using AXSparseAttributeSetterMap = 176 using AXSparseAttributeSetterMap =
177 HashMap<QualifiedName, SparseAttributeSetter*>; 177 HashMap<QualifiedName, SparseAttributeSetter*>;
178 178
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 } 2460 }
2461 2461
2462 // Get default value if object is not laid out. 2462 // Get default value if object is not laid out.
2463 // If object is laid out, it will have a layout object for the label. 2463 // If object is laid out, it will have a layout object for the label.
2464 if (!getLayoutObject()) { 2464 if (!getLayoutObject()) {
2465 String defaultLabel = inputElement->valueOrDefaultLabel(); 2465 String defaultLabel = inputElement->valueOrDefaultLabel();
2466 if (value.isNull() && !defaultLabel.isNull()) { 2466 if (value.isNull() && !defaultLabel.isNull()) {
2467 // default label 2467 // default label
2468 nameFrom = AXNameFromContents; 2468 nameFrom = AXNameFromContents;
2469 if (nameSources) { 2469 if (nameSources) {
2470 nameSources->append(NameSource(*foundTextAlternative)); 2470 nameSources->push_back(NameSource(*foundTextAlternative));
2471 nameSources->back().type = nameFrom; 2471 nameSources->back().type = nameFrom;
2472 } 2472 }
2473 textAlternative = defaultLabel; 2473 textAlternative = defaultLabel;
2474 if (nameSources) { 2474 if (nameSources) {
2475 NameSource& source = nameSources->back(); 2475 NameSource& source = nameSources->back();
2476 source.text = textAlternative; 2476 source.text = textAlternative;
2477 *foundTextAlternative = true; 2477 *foundTextAlternative = true;
2478 } else { 2478 } else {
2479 return textAlternative; 2479 return textAlternative;
2480 } 2480 }
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
3072 return String(); 3072 return String();
3073 return toTextControlElement(node)->strippedPlaceholder(); 3073 return toTextControlElement(node)->strippedPlaceholder();
3074 } 3074 }
3075 3075
3076 DEFINE_TRACE(AXNodeObject) { 3076 DEFINE_TRACE(AXNodeObject) {
3077 visitor->trace(m_node); 3077 visitor->trace(m_node);
3078 AXObject::trace(visitor); 3078 AXObject::trace(visitor);
3079 } 3079 }
3080 3080
3081 } // namespace blink 3081 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698