Changeset 130780 in webkit
- Timestamp:
- Oct 9, 2012, 11:36:17 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r130779 r130780 1 2012-10-09 Florin Malita <fmalita@chromium.org> 2 3 SVGResources should use HashSet<AtomicString> instead of HashSet<AtomicStringImpl*> 4 https://bugs.webkit.org/show_bug.cgi?id=98683 5 6 Reviewed by Darin Adler. 7 8 Eric's notes: 9 10 SVGResources should use HashSet<AtomicString> instead of HashSet<AtomicStringImpl*> 11 They do basically the same thing, and the former is much more common (and less code). It's 12 also safe, on the off-chance that we're using AtomicStrings which might otherwise go away. 13 14 No new tests, refactoring. 15 16 * rendering/svg/SVGResources.cpp: 17 (WebCore::clipperFilterMaskerTags): 18 (WebCore::markerTags): 19 (WebCore::fillAndStrokeTags): 20 (WebCore::chainableResourceTags): 21 (WebCore::SVGResources::buildCachedResources): 22 1 23 2012-10-09 Enrica Casucci <enrica@apple.com> 2 24 -
trunk/Source/WebCore/rendering/svg/SVGResources.cpp
r100045 r130780 45 45 } 46 46 47 static HashSet<AtomicString Impl*>& clipperFilterMaskerTags()48 { 49 DEFINE_STATIC_LOCAL(HashSet<AtomicString Impl*>, s_tagList, ());47 static HashSet<AtomicString>& clipperFilterMaskerTags() 48 { 49 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 50 50 if (s_tagList.isEmpty()) { 51 51 // "container elements": http://www.w3.org/TR/SVG11/intro.html#TermContainerElement 52 52 // "graphics elements" : http://www.w3.org/TR/SVG11/intro.html#TermGraphicsElement 53 s_tagList.add(SVGNames::aTag.localName() .impl());54 s_tagList.add(SVGNames::circleTag.localName() .impl());55 s_tagList.add(SVGNames::ellipseTag.localName() .impl());56 s_tagList.add(SVGNames::glyphTag.localName() .impl());57 s_tagList.add(SVGNames::gTag.localName() .impl());58 s_tagList.add(SVGNames::imageTag.localName() .impl());59 s_tagList.add(SVGNames::lineTag.localName() .impl());60 s_tagList.add(SVGNames::markerTag.localName() .impl());61 s_tagList.add(SVGNames::maskTag.localName() .impl());62 s_tagList.add(SVGNames::missing_glyphTag.localName() .impl());63 s_tagList.add(SVGNames::pathTag.localName() .impl());64 s_tagList.add(SVGNames::polygonTag.localName() .impl());65 s_tagList.add(SVGNames::polylineTag.localName() .impl());66 s_tagList.add(SVGNames::rectTag.localName() .impl());67 s_tagList.add(SVGNames::svgTag.localName() .impl());68 s_tagList.add(SVGNames::textTag.localName() .impl());69 s_tagList.add(SVGNames::useTag.localName() .impl());53 s_tagList.add(SVGNames::aTag.localName()); 54 s_tagList.add(SVGNames::circleTag.localName()); 55 s_tagList.add(SVGNames::ellipseTag.localName()); 56 s_tagList.add(SVGNames::glyphTag.localName()); 57 s_tagList.add(SVGNames::gTag.localName()); 58 s_tagList.add(SVGNames::imageTag.localName()); 59 s_tagList.add(SVGNames::lineTag.localName()); 60 s_tagList.add(SVGNames::markerTag.localName()); 61 s_tagList.add(SVGNames::maskTag.localName()); 62 s_tagList.add(SVGNames::missing_glyphTag.localName()); 63 s_tagList.add(SVGNames::pathTag.localName()); 64 s_tagList.add(SVGNames::polygonTag.localName()); 65 s_tagList.add(SVGNames::polylineTag.localName()); 66 s_tagList.add(SVGNames::rectTag.localName()); 67 s_tagList.add(SVGNames::svgTag.localName()); 68 s_tagList.add(SVGNames::textTag.localName()); 69 s_tagList.add(SVGNames::useTag.localName()); 70 70 71 71 // Not listed in the definitions is the clipPath element, the SVG spec says though: … … 73 73 // So we have to add clipPathTag here, otherwhise clip-path on clipPath will fail. 74 74 // (Already mailed SVG WG, waiting for a solution) 75 s_tagList.add(SVGNames::clipPathTag.localName() .impl());75 s_tagList.add(SVGNames::clipPathTag.localName()); 76 76 77 77 // Not listed in the definitions are the text content elements, though filter/clipper/masker on tspan/text/.. is allowed. 78 78 // (Already mailed SVG WG, waiting for a solution) 79 s_tagList.add(SVGNames::altGlyphTag.localName() .impl());80 s_tagList.add(SVGNames::textPathTag.localName() .impl());81 s_tagList.add(SVGNames::trefTag.localName() .impl());82 s_tagList.add(SVGNames::tspanTag.localName() .impl());79 s_tagList.add(SVGNames::altGlyphTag.localName()); 80 s_tagList.add(SVGNames::textPathTag.localName()); 81 s_tagList.add(SVGNames::trefTag.localName()); 82 s_tagList.add(SVGNames::tspanTag.localName()); 83 83 84 84 // Not listed in the definitions is the foreignObject element, but clip-path 85 85 // is a supported attribute. 86 s_tagList.add(SVGNames::foreignObjectTag.localName() .impl());86 s_tagList.add(SVGNames::foreignObjectTag.localName()); 87 87 88 88 // Elements that we ignore, as it doesn't make any sense. … … 94 94 } 95 95 96 static HashSet<AtomicString Impl*>& markerTags()97 { 98 DEFINE_STATIC_LOCAL(HashSet<AtomicString Impl*>, s_tagList, ());96 static HashSet<AtomicString>& markerTags() 97 { 98 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 99 99 if (s_tagList.isEmpty()) { 100 s_tagList.add(SVGNames::lineTag.localName() .impl());101 s_tagList.add(SVGNames::pathTag.localName() .impl());102 s_tagList.add(SVGNames::polygonTag.localName() .impl());103 s_tagList.add(SVGNames::polylineTag.localName() .impl());100 s_tagList.add(SVGNames::lineTag.localName()); 101 s_tagList.add(SVGNames::pathTag.localName()); 102 s_tagList.add(SVGNames::polygonTag.localName()); 103 s_tagList.add(SVGNames::polylineTag.localName()); 104 104 } 105 105 … … 107 107 } 108 108 109 static HashSet<AtomicString Impl*>& fillAndStrokeTags()110 { 111 DEFINE_STATIC_LOCAL(HashSet<AtomicString Impl*>, s_tagList, ());109 static HashSet<AtomicString>& fillAndStrokeTags() 110 { 111 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 112 112 if (s_tagList.isEmpty()) { 113 s_tagList.add(SVGNames::altGlyphTag.localName() .impl());114 s_tagList.add(SVGNames::circleTag.localName() .impl());115 s_tagList.add(SVGNames::ellipseTag.localName() .impl());116 s_tagList.add(SVGNames::lineTag.localName() .impl());117 s_tagList.add(SVGNames::pathTag.localName() .impl());118 s_tagList.add(SVGNames::polygonTag.localName() .impl());119 s_tagList.add(SVGNames::polylineTag.localName() .impl());120 s_tagList.add(SVGNames::rectTag.localName() .impl());121 s_tagList.add(SVGNames::textTag.localName() .impl());122 s_tagList.add(SVGNames::textPathTag.localName() .impl());123 s_tagList.add(SVGNames::trefTag.localName() .impl());124 s_tagList.add(SVGNames::tspanTag.localName() .impl());113 s_tagList.add(SVGNames::altGlyphTag.localName()); 114 s_tagList.add(SVGNames::circleTag.localName()); 115 s_tagList.add(SVGNames::ellipseTag.localName()); 116 s_tagList.add(SVGNames::lineTag.localName()); 117 s_tagList.add(SVGNames::pathTag.localName()); 118 s_tagList.add(SVGNames::polygonTag.localName()); 119 s_tagList.add(SVGNames::polylineTag.localName()); 120 s_tagList.add(SVGNames::rectTag.localName()); 121 s_tagList.add(SVGNames::textTag.localName()); 122 s_tagList.add(SVGNames::textPathTag.localName()); 123 s_tagList.add(SVGNames::trefTag.localName()); 124 s_tagList.add(SVGNames::tspanTag.localName()); 125 125 } 126 126 … … 128 128 } 129 129 130 static HashSet<AtomicString Impl*>& chainableResourceTags()131 { 132 DEFINE_STATIC_LOCAL(HashSet<AtomicString Impl*>, s_tagList, ());130 static HashSet<AtomicString>& chainableResourceTags() 131 { 132 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 133 133 if (s_tagList.isEmpty()) { 134 s_tagList.add(SVGNames::linearGradientTag.localName() .impl());135 s_tagList.add(SVGNames::filterTag.localName() .impl());136 s_tagList.add(SVGNames::patternTag.localName() .impl());137 s_tagList.add(SVGNames::radialGradientTag.localName() .impl());134 s_tagList.add(SVGNames::linearGradientTag.localName()); 135 s_tagList.add(SVGNames::filterTag.localName()); 136 s_tagList.add(SVGNames::patternTag.localName()); 137 s_tagList.add(SVGNames::radialGradientTag.localName()); 138 138 } 139 139 … … 203 203 ASSERT(extensions); 204 204 205 AtomicStringImpl* tagNameImpl = element->tagQName().localName().impl();206 if ( !tagNameImpl)205 const AtomicString& tagName = element->localName(); 206 if (tagName.isNull()) 207 207 return false; 208 208 209 209 bool foundResources = false; 210 if (clipperFilterMaskerTags().contains(tagName Impl)) {210 if (clipperFilterMaskerTags().contains(tagName)) { 211 211 if (style->hasClipper()) { 212 212 AtomicString id(style->clipperResource()); … … 236 236 } 237 237 238 if (markerTags().contains(tagName Impl) && style->hasMarkers()) {238 if (markerTags().contains(tagName) && style->hasMarkers()) { 239 239 AtomicString markerStartId(style->markerStartResource()); 240 240 if (setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId))) … … 256 256 } 257 257 258 if (fillAndStrokeTags().contains(tagName Impl)) {258 if (fillAndStrokeTags().contains(tagName)) { 259 259 if (style->hasFill()) { 260 260 bool hasPendingResource = false; … … 276 276 } 277 277 278 if (chainableResourceTags().contains(tagName Impl)) {278 if (chainableResourceTags().contains(tagName)) { 279 279 AtomicString id(targetReferenceFromResource(element)); 280 280 if (setLinkedResource(getRenderSVGResourceContainerById(document, id)))
Note:
See TracChangeset
for help on using the changeset viewer.