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

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2142513003: Use initializer_lists for static WTF::HashSets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index e6d6b6eb2f0cd68c53b41a7142f8aaed513e057d..d2249021f281159e2856e17df5624030ad5800ed 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -249,29 +249,28 @@ static bool isDisallowedElement(const Element& element)
if (!element.isSVGElement())
return true;
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedElementTags, ());
- if (allowedElementTags.isEmpty()) {
- allowedElementTags.add(SVGNames::aTag);
- allowedElementTags.add(SVGNames::circleTag);
- allowedElementTags.add(SVGNames::descTag);
- allowedElementTags.add(SVGNames::ellipseTag);
- allowedElementTags.add(SVGNames::gTag);
- allowedElementTags.add(SVGNames::imageTag);
- allowedElementTags.add(SVGNames::lineTag);
- allowedElementTags.add(SVGNames::metadataTag);
- allowedElementTags.add(SVGNames::pathTag);
- allowedElementTags.add(SVGNames::polygonTag);
- allowedElementTags.add(SVGNames::polylineTag);
- allowedElementTags.add(SVGNames::rectTag);
- allowedElementTags.add(SVGNames::svgTag);
- allowedElementTags.add(SVGNames::switchTag);
- allowedElementTags.add(SVGNames::symbolTag);
- allowedElementTags.add(SVGNames::textTag);
- allowedElementTags.add(SVGNames::textPathTag);
- allowedElementTags.add(SVGNames::titleTag);
- allowedElementTags.add(SVGNames::tspanTag);
- allowedElementTags.add(SVGNames::useTag);
- }
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedElementTags, ({
+ SVGNames::aTag,
+ SVGNames::circleTag,
+ SVGNames::descTag,
+ SVGNames::ellipseTag,
+ SVGNames::gTag,
+ SVGNames::imageTag,
+ SVGNames::lineTag,
+ SVGNames::metadataTag,
+ SVGNames::pathTag,
+ SVGNames::polygonTag,
+ SVGNames::polylineTag,
+ SVGNames::rectTag,
+ SVGNames::svgTag,
+ SVGNames::switchTag,
+ SVGNames::symbolTag,
+ SVGNames::textTag,
+ SVGNames::textPathTag,
+ SVGNames::titleTag,
+ SVGNames::tspanTag,
+ SVGNames::useTag,
+ }));
return !allowedElementTags.contains<SVGAttributeHashTranslator>(element.tagQName());
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGLength.cpp ('k') | third_party/WebKit/Source/core/xml/XPathParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698