OLD | NEW |
---|---|
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 Loading... | |
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() | |
95 { | |
96 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); | |
97 if (s_tagList.isEmpty()) { | |
98 s_tagList.add(SVGNames::lineTag.localName()); | |
99 s_tagList.add(SVGNames::pathTag.localName()); | |
100 s_tagList.add(SVGNames::polygonTag.localName()); | |
101 s_tagList.add(SVGNames::polylineTag.localName()); | |
102 } | |
103 | |
104 return s_tagList; | |
105 } | |
106 | |
107 static HashSet<AtomicString>& fillAndStrokeTags() | 94 static HashSet<AtomicString>& fillAndStrokeTags() |
108 { | 95 { |
109 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); | 96 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, s_tagList, ()); |
110 if (s_tagList.isEmpty()) { | 97 if (s_tagList.isEmpty()) { |
111 s_tagList.add(SVGNames::altGlyphTag.localName()); | 98 s_tagList.add(SVGNames::altGlyphTag.localName()); |
112 s_tagList.add(SVGNames::circleTag.localName()); | 99 s_tagList.add(SVGNames::circleTag.localName()); |
113 s_tagList.add(SVGNames::ellipseTag.localName()); | 100 s_tagList.add(SVGNames::ellipseTag.localName()); |
114 s_tagList.add(SVGNames::lineTag.localName()); | 101 s_tagList.add(SVGNames::lineTag.localName()); |
115 s_tagList.add(SVGNames::pathTag.localName()); | 102 s_tagList.add(SVGNames::pathTag.localName()); |
116 s_tagList.add(SVGNames::polygonTag.localName()); | 103 s_tagList.add(SVGNames::polygonTag.localName()); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 registerPendingResource(extensions, id, element); | 230 registerPendingResource(extensions, id, element); |
244 } | 231 } |
245 | 232 |
246 if (style->hasMasker()) { | 233 if (style->hasMasker()) { |
247 AtomicString id = style->maskerResource(); | 234 AtomicString id = style->maskerResource(); |
248 if (!ensureResources(resources)->setMasker(getRenderSVGResourceById< RenderSVGResourceMasker>(document, id))) | 235 if (!ensureResources(resources)->setMasker(getRenderSVGResourceById< RenderSVGResourceMasker>(document, id))) |
249 registerPendingResource(extensions, id, element); | 236 registerPendingResource(extensions, id, element); |
250 } | 237 } |
251 } | 238 } |
252 | 239 |
253 if (markerTags().contains(tagName) && style->hasMarkers()) { | 240 if (element->supportsMarkers() && style->hasMarkers()) { |
f(malita)
2014/03/19 14:58:55
Let's invert the order here - I suspect style->has
| |
254 AtomicString markerStartId(style->markerStartResource()); | 241 AtomicString markerStartId(style->markerStartResource()); |
255 if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById <RenderSVGResourceMarker>(document, markerStartId))) | 242 if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById <RenderSVGResourceMarker>(document, markerStartId))) |
256 registerPendingResource(extensions, markerStartId, element); | 243 registerPendingResource(extensions, markerStartId, element); |
257 | 244 |
258 AtomicString markerMidId(style->markerMidResource()); | 245 AtomicString markerMidId(style->markerMidResource()); |
259 if (!ensureResources(resources)->setMarkerMid(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerMidId))) | 246 if (!ensureResources(resources)->setMarkerMid(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerMidId))) |
260 registerPendingResource(extensions, markerMidId, element); | 247 registerPendingResource(extensions, markerMidId, element); |
261 | 248 |
262 AtomicString markerEndId(style->markerEndResource()); | 249 AtomicString markerEndId(style->markerEndResource()); |
263 if (!ensureResources(resources)->setMarkerEnd(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerEndId))) | 250 if (!ensureResources(resources)->setMarkerEnd(getRenderSVGResourceById<R enderSVGResourceMarker>(document, markerEndId))) |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
699 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) | 686 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) |
700 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element()); | 687 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element()); |
701 } | 688 } |
702 | 689 |
703 if (m_linkedResource) | 690 if (m_linkedResource) |
704 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element()); | 691 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element()); |
705 } | 692 } |
706 #endif | 693 #endif |
707 | 694 |
708 } | 695 } |
OLD | NEW |