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

Side by Side Diff: third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 AttributeCollection attributes = element.attributesWithoutUpdate(); 136 AttributeCollection attributes = element.attributesWithoutUpdate();
137 for (const Attribute& attr : attributes) { 137 for (const Attribute& attr : attributes) {
138 if (!element.isPresentationAttribute(attr.name())) 138 if (!element.isPresentationAttribute(attr.name()))
139 continue; 139 continue;
140 if (!attr.namespaceURI().isNull()) 140 if (!attr.namespaceURI().isNull())
141 return; 141 return;
142 // FIXME: Background URL may depend on the base URL and can't be shared. 142 // FIXME: Background URL may depend on the base URL and can't be shared.
143 // Disallow caching. 143 // Disallow caching.
144 if (attr.name() == backgroundAttr) 144 if (attr.name() == backgroundAttr)
145 return; 145 return;
146 result.attributesAndValues.append( 146 result.attributesAndValues.push_back(
147 std::make_pair(attr.localName().impl(), attr.value())); 147 std::make_pair(attr.localName().impl(), attr.value()));
148 } 148 }
149 if (result.attributesAndValues.isEmpty()) 149 if (result.attributesAndValues.isEmpty())
150 return; 150 return;
151 // Attribute order doesn't matter. Sort for easy equality comparison. 151 // Attribute order doesn't matter. Sort for easy equality comparison.
152 std::sort(result.attributesAndValues.begin(), 152 std::sort(result.attributesAndValues.begin(),
153 result.attributesAndValues.end(), attributeNameSort); 153 result.attributesAndValues.end(), attributeNameSort);
154 // The cache key is non-null when the tagName is set. 154 // The cache key is non-null when the tagName is set.
155 result.tagName = element.localName().impl(); 155 result.tagName = element.localName().impl();
156 } 156 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 presentationAttributeCache().clear(); 215 presentationAttributeCache().clear();
216 presentationAttributeCache().set(cacheHash, newEntry); 216 presentationAttributeCache().set(cacheHash, newEntry);
217 } else { 217 } else {
218 cacheValue->value = newEntry; 218 cacheValue->value = newEntry;
219 } 219 }
220 220
221 return style; 221 return style;
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.h ('k') | third_party/WebKit/Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698