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

Side by Side Diff: Source/core/rendering/svg/SVGResources.cpp

Issue 203193008: Make supportsMarkers non virtual (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against ToT Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/svg/SVGResources.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 s_tagList.add(SVGNames::foreignObjectTag.localName()); 84 s_tagList.add(SVGNames::foreignObjectTag.localName());
85 85
86 // Elements that we ignore, as it doesn't make any sense. 86 // Elements that we ignore, as it doesn't make any sense.
87 // defs, pattern, switch (FIXME: Mail SVG WG about these) 87 // defs, pattern, switch (FIXME: Mail SVG WG about these)
88 // symbol (is converted to a svg element, when referenced by use, we can safely ignore it.) 88 // symbol (is converted to a svg element, when referenced by use, we can safely ignore it.)
89 } 89 }
90 90
91 return s_tagList; 91 return s_tagList;
92 } 92 }
93 93
94 static HashSet<AtomicString>& markerTags() 94 bool SVGResources::supportsMarkers(const SVGElement& element)
95 { 95 {
96 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 96 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
97 if (s_tagList.isEmpty()) { 97 if (s_tagList.isEmpty()) {
98 s_tagList.add(SVGNames::lineTag.localName()); 98 s_tagList.add(SVGNames::lineTag.localName());
99 s_tagList.add(SVGNames::pathTag.localName()); 99 s_tagList.add(SVGNames::pathTag.localName());
100 s_tagList.add(SVGNames::polygonTag.localName()); 100 s_tagList.add(SVGNames::polygonTag.localName());
101 s_tagList.add(SVGNames::polylineTag.localName()); 101 s_tagList.add(SVGNames::polylineTag.localName());
102 } 102 }
103 103
104 return s_tagList; 104 return s_tagList.contains(element.localName());
105 } 105 }
106 106
107 static HashSet<AtomicString>& fillAndStrokeTags() 107 static HashSet<AtomicString>& fillAndStrokeTags()
108 { 108 {
109 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); 109 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ());
110 if (s_tagList.isEmpty()) { 110 if (s_tagList.isEmpty()) {
111 s_tagList.add(SVGNames::altGlyphTag.localName()); 111 s_tagList.add(SVGNames::altGlyphTag.localName());
112 s_tagList.add(SVGNames::circleTag.localName()); 112 s_tagList.add(SVGNames::circleTag.localName());
113 s_tagList.add(SVGNames::ellipseTag.localName()); 113 s_tagList.add(SVGNames::ellipseTag.localName());
114 s_tagList.add(SVGNames::lineTag.localName()); 114 s_tagList.add(SVGNames::lineTag.localName());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 registerPendingResource(extensions, id, element); 243 registerPendingResource(extensions, id, element);
244 } 244 }
245 245
246 if (style->hasMasker()) { 246 if (style->hasMasker()) {
247 AtomicString id = style->maskerResource(); 247 AtomicString id = style->maskerResource();
248 if (!ensureResources(resources)->setMasker(getRenderSVGResourceById< RenderSVGResourceMasker>(document, id))) 248 if (!ensureResources(resources)->setMasker(getRenderSVGResourceById< RenderSVGResourceMasker>(document, id)))
249 registerPendingResource(extensions, id, element); 249 registerPendingResource(extensions, id, element);
250 } 250 }
251 } 251 }
252 252
253 if (markerTags().contains(tagName) && style->hasMarkers()) { 253 if (style->hasMarkers() && supportsMarkers(*element)) {
254 const AtomicString& markerStartId = style->markerStartResource(); 254 const AtomicString& markerStartId = style->markerStartResource();
255 if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById <RenderSVGResourceMarker>(document, markerStartId))) 255 if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById <RenderSVGResourceMarker>(document, markerStartId)))
256 registerPendingResource(extensions, markerStartId, element); 256 registerPendingResource(extensions, markerStartId, element);
257 257
258 const AtomicString& markerMidId = style->markerMidResource(); 258 const AtomicString& markerMidId = style->markerMidResource();
259 if (!ensureResources(resources)->setMarkerMid(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerMidId))) 259 if (!ensureResources(resources)->setMarkerMid(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerMidId)))
260 registerPendingResource(extensions, markerMidId, element); 260 registerPendingResource(extensions, markerMidId, element);
261 261
262 const AtomicString& markerEndId = style->markerEndResource(); 262 const AtomicString& markerEndId = style->markerEndResource();
263 if (!ensureResources(resources)->setMarkerEnd(getRenderSVGResourceById<R enderSVGResourceMarker>(document, style->markerEndResource()))) 263 if (!ensureResources(resources)->setMarkerEnd(getRenderSVGResourceById<R enderSVGResourceMarker>(document, style->markerEndResource())))
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) 699 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke)
700 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element()); 700 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element());
701 } 701 }
702 702
703 if (m_linkedResource) 703 if (m_linkedResource)
704 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element()); 704 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element());
705 } 705 }
706 #endif 706 #endif
707 707
708 } 708 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGResources.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698