1 /*
2 * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
3 *
4 * This file was generated by the dom/make_names.pl script.
5 *
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
21 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #include "config.h"
31
32 #if ENABLE(SVG)
33
34 #include "SVGElementFactory.h"
35 #include "SVGNames.h"
36 #include "SVGAElement.h"
37 #include "SVGAltGlyphElement.h"
38 #include "SVGAnimateElement.h"
39 #include "SVGAnimateColorElement.h"
40 #include "SVGAnimateMotionElement.h"
41 #include "SVGAnimateTransformElement.h"
42 #include "SVGCircleElement.h"
43 #include "SVGClipPathElement.h"
44 #include "SVGCursorElement.h"
45 #include "SVGDefsElement.h"
46 #include "SVGDescElement.h"
47 #include "SVGEllipseElement.h"
48 #include "SVGFEBlendElement.h"
49 #include "SVGFEColorMatrixElement.h"
50 #include "SVGFEComponentTransferElement.h"
51 #include "SVGFECompositeElement.h"
52 #include "SVGFEConvolveMatrixElement.h"
53 #include "SVGFEDiffuseLightingElement.h"
54 #include "SVGFEDisplacementMapElement.h"
55 #include "SVGFEDistantLightElement.h"
56 #include "SVGFEDropShadowElement.h"
57 #include "SVGFEFloodElement.h"
58 #include "SVGFEFuncAElement.h"
59 #include "SVGFEFuncBElement.h"
60 #include "SVGFEFuncGElement.h"
61 #include "SVGFEFuncRElement.h"
62 #include "SVGFEGaussianBlurElement.h"
63 #include "SVGFEImageElement.h"
64 #include "SVGFEMergeElement.h"
65 #include "SVGFEMergeNodeElement.h"
66 #include "SVGFEMorphologyElement.h"
67 #include "SVGFEOffsetElement.h"
68 #include "SVGFEPointLightElement.h"
69 #include "SVGFESpecularLightingElement.h"
70 #include "SVGFESpotLightElement.h"
71 #include "SVGFETileElement.h"
72 #include "SVGFETurbulenceElement.h"
73 #include "SVGFilterElement.h"
74 #include "SVGFontElement.h"
75 #include "SVGFontFaceElement.h"
76 #include "SVGFontFaceFormatElement.h"
77 #include "SVGFontFaceNameElement.h"
78 #include "SVGFontFaceSrcElement.h"
79 #include "SVGFontFaceUriElement.h"
80 #include "SVGForeignObjectElement.h"
81 #include "SVGGElement.h"
82 #include "SVGGlyphElement.h"
83 #include "SVGHKernElement.h"
84 #include "SVGImageElement.h"
85 #include "SVGLineElement.h"
86 #include "SVGLinearGradientElement.h"
87 #include "SVGMarkerElement.h"
88 #include "SVGMaskElement.h"
89 #include "SVGMetadataElement.h"
90 #include "SVGMissingGlyphElement.h"
91 #include "SVGMPathElement.h"
92 #include "SVGPathElement.h"
93 #include "SVGPatternElement.h"
94 #include "SVGPolygonElement.h"
95 #include "SVGPolylineElement.h"
96 #include "SVGRadialGradientElement.h"
97 #include "SVGRectElement.h"
98 #include "SVGScriptElement.h"
99 #include "SVGSetElement.h"
100 #include "SVGStopElement.h"
101 #include "SVGStyleElement.h"
102 #include "SVGSVGElement.h"
103 #include "SVGSwitchElement.h"
104 #include "SVGSymbolElement.h"
105 #include "SVGTextElement.h"
106 #include "SVGTextPathElement.h"
107 #include "SVGTitleElement.h"
108 #include "SVGTRefElement.h"
109 #include "SVGTSpanElement.h"
110 #include "SVGUseElement.h"
111 #include "SVGViewElement.h"
112 #include "SVGVKernElement.h"
113
114 #include <wtf/HashMap.h>
115
116 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(VIDEO)
117 #include "Document.h"
118 #include "Settings.h"
119 #endif
120
121 namespace WebCore {
122
123 using namespace SVGNames;
124
125 typedef PassRefPtr<SVGElement> (*ConstructorFunction)(const QualifiedName&, Document*, bool createdByParser);
126 typedef HashMap<AtomicStringImpl*, ConstructorFunction> FunctionMap;
127
128 static FunctionMap* gFunctionMap = 0;
129
aConstructor(const QualifiedName & tagName,Document * document,bool)130 static PassRefPtr<SVGElement> aConstructor(const QualifiedName& tagName, Document* document, bool)
131 {
132 return SVGAElement::create(tagName, document);
133 }
134
altglyphConstructor(const QualifiedName & tagName,Document * document,bool)135 static PassRefPtr<SVGElement> altglyphConstructor(const QualifiedName& tagName, Document* document, bool)
136 {
137 return SVGAltGlyphElement::create(tagName, document);
138 }
139
animateConstructor(const QualifiedName & tagName,Document * document,bool)140 static PassRefPtr<SVGElement> animateConstructor(const QualifiedName& tagName, Document* document, bool)
141 {
142 return SVGAnimateElement::create(tagName, document);
143 }
144
animatecolorConstructor(const QualifiedName & tagName,Document * document,bool)145 static PassRefPtr<SVGElement> animatecolorConstructor(const QualifiedName& tagName, Document* document, bool)
146 {
147 return SVGAnimateColorElement::create(tagName, document);
148 }
149
animatemotionConstructor(const QualifiedName & tagName,Document * document,bool)150 static PassRefPtr<SVGElement> animatemotionConstructor(const QualifiedName& tagName, Document* document, bool)
151 {
152 return SVGAnimateMotionElement::create(tagName, document);
153 }
154
animatetransformConstructor(const QualifiedName & tagName,Document * document,bool)155 static PassRefPtr<SVGElement> animatetransformConstructor(const QualifiedName& tagName, Document* document, bool)
156 {
157 return SVGAnimateTransformElement::create(tagName, document);
158 }
159
circleConstructor(const QualifiedName & tagName,Document * document,bool)160 static PassRefPtr<SVGElement> circleConstructor(const QualifiedName& tagName, Document* document, bool)
161 {
162 return SVGCircleElement::create(tagName, document);
163 }
164
clippathConstructor(const QualifiedName & tagName,Document * document,bool)165 static PassRefPtr<SVGElement> clippathConstructor(const QualifiedName& tagName, Document* document, bool)
166 {
167 return SVGClipPathElement::create(tagName, document);
168 }
169
cursorConstructor(const QualifiedName & tagName,Document * document,bool)170 static PassRefPtr<SVGElement> cursorConstructor(const QualifiedName& tagName, Document* document, bool)
171 {
172 return SVGCursorElement::create(tagName, document);
173 }
174
defsConstructor(const QualifiedName & tagName,Document * document,bool)175 static PassRefPtr<SVGElement> defsConstructor(const QualifiedName& tagName, Document* document, bool)
176 {
177 return SVGDefsElement::create(tagName, document);
178 }
179
descConstructor(const QualifiedName & tagName,Document * document,bool)180 static PassRefPtr<SVGElement> descConstructor(const QualifiedName& tagName, Document* document, bool)
181 {
182 return SVGDescElement::create(tagName, document);
183 }
184
ellipseConstructor(const QualifiedName & tagName,Document * document,bool)185 static PassRefPtr<SVGElement> ellipseConstructor(const QualifiedName& tagName, Document* document, bool)
186 {
187 return SVGEllipseElement::create(tagName, document);
188 }
189
feblendConstructor(const QualifiedName & tagName,Document * document,bool)190 static PassRefPtr<SVGElement> feblendConstructor(const QualifiedName& tagName, Document* document, bool)
191 {
192 return SVGFEBlendElement::create(tagName, document);
193 }
194
fecolormatrixConstructor(const QualifiedName & tagName,Document * document,bool)195 static PassRefPtr<SVGElement> fecolormatrixConstructor(const QualifiedName& tagName, Document* document, bool)
196 {
197 return SVGFEColorMatrixElement::create(tagName, document);
198 }
199
fecomponenttransferConstructor(const QualifiedName & tagName,Document * document,bool)200 static PassRefPtr<SVGElement> fecomponenttransferConstructor(const QualifiedName& tagName, Document* document, bool)
201 {
202 return SVGFEComponentTransferElement::create(tagName, document);
203 }
204
fecompositeConstructor(const QualifiedName & tagName,Document * document,bool)205 static PassRefPtr<SVGElement> fecompositeConstructor(const QualifiedName& tagName, Document* document, bool)
206 {
207 return SVGFECompositeElement::create(tagName, document);
208 }
209
feconvolvematrixConstructor(const QualifiedName & tagName,Document * document,bool)210 static PassRefPtr<SVGElement> feconvolvematrixConstructor(const QualifiedName& tagName, Document* document, bool)
211 {
212 return SVGFEConvolveMatrixElement::create(tagName, document);
213 }
214
fediffuselightingConstructor(const QualifiedName & tagName,Document * document,bool)215 static PassRefPtr<SVGElement> fediffuselightingConstructor(const QualifiedName& tagName, Document* document, bool)
216 {
217 return SVGFEDiffuseLightingElement::create(tagName, document);
218 }
219
fedisplacementmapConstructor(const QualifiedName & tagName,Document * document,bool)220 static PassRefPtr<SVGElement> fedisplacementmapConstructor(const QualifiedName& tagName, Document* document, bool)
221 {
222 return SVGFEDisplacementMapElement::create(tagName, document);
223 }
224
fedistantlightConstructor(const QualifiedName & tagName,Document * document,bool)225 static PassRefPtr<SVGElement> fedistantlightConstructor(const QualifiedName& tagName, Document* document, bool)
226 {
227 return SVGFEDistantLightElement::create(tagName, document);
228 }
229
fedropshadowConstructor(const QualifiedName & tagName,Document * document,bool)230 static PassRefPtr<SVGElement> fedropshadowConstructor(const QualifiedName& tagName, Document* document, bool)
231 {
232 return SVGFEDropShadowElement::create(tagName, document);
233 }
234
fefloodConstructor(const QualifiedName & tagName,Document * document,bool)235 static PassRefPtr<SVGElement> fefloodConstructor(const QualifiedName& tagName, Document* document, bool)
236 {
237 return SVGFEFloodElement::create(tagName, document);
238 }
239
fefuncaConstructor(const QualifiedName & tagName,Document * document,bool)240 static PassRefPtr<SVGElement> fefuncaConstructor(const QualifiedName& tagName, Document* document, bool)
241 {
242 return SVGFEFuncAElement::create(tagName, document);
243 }
244
fefuncbConstructor(const QualifiedName & tagName,Document * document,bool)245 static PassRefPtr<SVGElement> fefuncbConstructor(const QualifiedName& tagName, Document* document, bool)
246 {
247 return SVGFEFuncBElement::create(tagName, document);
248 }
249
fefuncgConstructor(const QualifiedName & tagName,Document * document,bool)250 static PassRefPtr<SVGElement> fefuncgConstructor(const QualifiedName& tagName, Document* document, bool)
251 {
252 return SVGFEFuncGElement::create(tagName, document);
253 }
254
fefuncrConstructor(const QualifiedName & tagName,Document * document,bool)255 static PassRefPtr<SVGElement> fefuncrConstructor(const QualifiedName& tagName, Document* document, bool)
256 {
257 return SVGFEFuncRElement::create(tagName, document);
258 }
259
fegaussianblurConstructor(const QualifiedName & tagName,Document * document,bool)260 static PassRefPtr<SVGElement> fegaussianblurConstructor(const QualifiedName& tagName, Document* document, bool)
261 {
262 return SVGFEGaussianBlurElement::create(tagName, document);
263 }
264
feimageConstructor(const QualifiedName & tagName,Document * document,bool)265 static PassRefPtr<SVGElement> feimageConstructor(const QualifiedName& tagName, Document* document, bool)
266 {
267 return SVGFEImageElement::create(tagName, document);
268 }
269
femergeConstructor(const QualifiedName & tagName,Document * document,bool)270 static PassRefPtr<SVGElement> femergeConstructor(const QualifiedName& tagName, Document* document, bool)
271 {
272 return SVGFEMergeElement::create(tagName, document);
273 }
274
femergenodeConstructor(const QualifiedName & tagName,Document * document,bool)275 static PassRefPtr<SVGElement> femergenodeConstructor(const QualifiedName& tagName, Document* document, bool)
276 {
277 return SVGFEMergeNodeElement::create(tagName, document);
278 }
279
femorphologyConstructor(const QualifiedName & tagName,Document * document,bool)280 static PassRefPtr<SVGElement> femorphologyConstructor(const QualifiedName& tagName, Document* document, bool)
281 {
282 return SVGFEMorphologyElement::create(tagName, document);
283 }
284
feoffsetConstructor(const QualifiedName & tagName,Document * document,bool)285 static PassRefPtr<SVGElement> feoffsetConstructor(const QualifiedName& tagName, Document* document, bool)
286 {
287 return SVGFEOffsetElement::create(tagName, document);
288 }
289
fepointlightConstructor(const QualifiedName & tagName,Document * document,bool)290 static PassRefPtr<SVGElement> fepointlightConstructor(const QualifiedName& tagName, Document* document, bool)
291 {
292 return SVGFEPointLightElement::create(tagName, document);
293 }
294
fespecularlightingConstructor(const QualifiedName & tagName,Document * document,bool)295 static PassRefPtr<SVGElement> fespecularlightingConstructor(const QualifiedName& tagName, Document* document, bool)
296 {
297 return SVGFESpecularLightingElement::create(tagName, document);
298 }
299
fespotlightConstructor(const QualifiedName & tagName,Document * document,bool)300 static PassRefPtr<SVGElement> fespotlightConstructor(const QualifiedName& tagName, Document* document, bool)
301 {
302 return SVGFESpotLightElement::create(tagName, document);
303 }
304
fetileConstructor(const QualifiedName & tagName,Document * document,bool)305 static PassRefPtr<SVGElement> fetileConstructor(const QualifiedName& tagName, Document* document, bool)
306 {
307 return SVGFETileElement::create(tagName, document);
308 }
309
feturbulenceConstructor(const QualifiedName & tagName,Document * document,bool)310 static PassRefPtr<SVGElement> feturbulenceConstructor(const QualifiedName& tagName, Document* document, bool)
311 {
312 return SVGFETurbulenceElement::create(tagName, document);
313 }
314
filterConstructor(const QualifiedName & tagName,Document * document,bool)315 static PassRefPtr<SVGElement> filterConstructor(const QualifiedName& tagName, Document* document, bool)
316 {
317 return SVGFilterElement::create(tagName, document);
318 }
319
fontConstructor(const QualifiedName & tagName,Document * document,bool)320 static PassRefPtr<SVGElement> fontConstructor(const QualifiedName& tagName, Document* document, bool)
321 {
322 return SVGFontElement::create(tagName, document);
323 }
324
fontfaceConstructor(const QualifiedName & tagName,Document * document,bool)325 static PassRefPtr<SVGElement> fontfaceConstructor(const QualifiedName& tagName, Document* document, bool)
326 {
327 return SVGFontFaceElement::create(tagName, document);
328 }
329
fontfaceformatConstructor(const QualifiedName & tagName,Document * document,bool)330 static PassRefPtr<SVGElement> fontfaceformatConstructor(const QualifiedName& tagName, Document* document, bool)
331 {
332 return SVGFontFaceFormatElement::create(tagName, document);
333 }
334
fontfacenameConstructor(const QualifiedName & tagName,Document * document,bool)335 static PassRefPtr<SVGElement> fontfacenameConstructor(const QualifiedName& tagName, Document* document, bool)
336 {
337 return SVGFontFaceNameElement::create(tagName, document);
338 }
339
fontfacesrcConstructor(const QualifiedName & tagName,Document * document,bool)340 static PassRefPtr<SVGElement> fontfacesrcConstructor(const QualifiedName& tagName, Document* document, bool)
341 {
342 return SVGFontFaceSrcElement::create(tagName, document);
343 }
344
fontfaceuriConstructor(const QualifiedName & tagName,Document * document,bool)345 static PassRefPtr<SVGElement> fontfaceuriConstructor(const QualifiedName& tagName, Document* document, bool)
346 {
347 return SVGFontFaceUriElement::create(tagName, document);
348 }
349
foreignobjectConstructor(const QualifiedName & tagName,Document * document,bool)350 static PassRefPtr<SVGElement> foreignobjectConstructor(const QualifiedName& tagName, Document* document, bool)
351 {
352 return SVGForeignObjectElement::create(tagName, document);
353 }
354
gConstructor(const QualifiedName & tagName,Document * document,bool)355 static PassRefPtr<SVGElement> gConstructor(const QualifiedName& tagName, Document* document, bool)
356 {
357 return SVGGElement::create(tagName, document);
358 }
359
glyphConstructor(const QualifiedName & tagName,Document * document,bool)360 static PassRefPtr<SVGElement> glyphConstructor(const QualifiedName& tagName, Document* document, bool)
361 {
362 return SVGGlyphElement::create(tagName, document);
363 }
364
hkernConstructor(const QualifiedName & tagName,Document * document,bool)365 static PassRefPtr<SVGElement> hkernConstructor(const QualifiedName& tagName, Document* document, bool)
366 {
367 return SVGHKernElement::create(tagName, document);
368 }
369
imageConstructor(const QualifiedName & tagName,Document * document,bool)370 static PassRefPtr<SVGElement> imageConstructor(const QualifiedName& tagName, Document* document, bool)
371 {
372 return SVGImageElement::create(tagName, document);
373 }
374
lineConstructor(const QualifiedName & tagName,Document * document,bool)375 static PassRefPtr<SVGElement> lineConstructor(const QualifiedName& tagName, Document* document, bool)
376 {
377 return SVGLineElement::create(tagName, document);
378 }
379
lineargradientConstructor(const QualifiedName & tagName,Document * document,bool)380 static PassRefPtr<SVGElement> lineargradientConstructor(const QualifiedName& tagName, Document* document, bool)
381 {
382 return SVGLinearGradientElement::create(tagName, document);
383 }
384
markerConstructor(const QualifiedName & tagName,Document * document,bool)385 static PassRefPtr<SVGElement> markerConstructor(const QualifiedName& tagName, Document* document, bool)
386 {
387 return SVGMarkerElement::create(tagName, document);
388 }
389
maskConstructor(const QualifiedName & tagName,Document * document,bool)390 static PassRefPtr<SVGElement> maskConstructor(const QualifiedName& tagName, Document* document, bool)
391 {
392 return SVGMaskElement::create(tagName, document);
393 }
394
metadataConstructor(const QualifiedName & tagName,Document * document,bool)395 static PassRefPtr<SVGElement> metadataConstructor(const QualifiedName& tagName, Document* document, bool)
396 {
397 return SVGMetadataElement::create(tagName, document);
398 }
399
missingglyphConstructor(const QualifiedName & tagName,Document * document,bool)400 static PassRefPtr<SVGElement> missingglyphConstructor(const QualifiedName& tagName, Document* document, bool)
401 {
402 return SVGMissingGlyphElement::create(tagName, document);
403 }
404
mpathConstructor(const QualifiedName & tagName,Document * document,bool)405 static PassRefPtr<SVGElement> mpathConstructor(const QualifiedName& tagName, Document* document, bool)
406 {
407 return SVGMPathElement::create(tagName, document);
408 }
409
pathConstructor(const QualifiedName & tagName,Document * document,bool)410 static PassRefPtr<SVGElement> pathConstructor(const QualifiedName& tagName, Document* document, bool)
411 {
412 return SVGPathElement::create(tagName, document);
413 }
414
patternConstructor(const QualifiedName & tagName,Document * document,bool)415 static PassRefPtr<SVGElement> patternConstructor(const QualifiedName& tagName, Document* document, bool)
416 {
417 return SVGPatternElement::create(tagName, document);
418 }
419
polygonConstructor(const QualifiedName & tagName,Document * document,bool)420 static PassRefPtr<SVGElement> polygonConstructor(const QualifiedName& tagName, Document* document, bool)
421 {
422 return SVGPolygonElement::create(tagName, document);
423 }
424
polylineConstructor(const QualifiedName & tagName,Document * document,bool)425 static PassRefPtr<SVGElement> polylineConstructor(const QualifiedName& tagName, Document* document, bool)
426 {
427 return SVGPolylineElement::create(tagName, document);
428 }
429
radialgradientConstructor(const QualifiedName & tagName,Document * document,bool)430 static PassRefPtr<SVGElement> radialgradientConstructor(const QualifiedName& tagName, Document* document, bool)
431 {
432 return SVGRadialGradientElement::create(tagName, document);
433 }
434
rectConstructor(const QualifiedName & tagName,Document * document,bool)435 static PassRefPtr<SVGElement> rectConstructor(const QualifiedName& tagName, Document* document, bool)
436 {
437 return SVGRectElement::create(tagName, document);
438 }
439
scriptConstructor(const QualifiedName & tagName,Document * document,bool createdByParser)440 static PassRefPtr<SVGElement> scriptConstructor(const QualifiedName& tagName, Document* document, bool createdByParser)
441 {
442 return SVGScriptElement::create(tagName, document, createdByParser);
443 }
444
setConstructor(const QualifiedName & tagName,Document * document,bool)445 static PassRefPtr<SVGElement> setConstructor(const QualifiedName& tagName, Document* document, bool)
446 {
447 return SVGSetElement::create(tagName, document);
448 }
449
stopConstructor(const QualifiedName & tagName,Document * document,bool)450 static PassRefPtr<SVGElement> stopConstructor(const QualifiedName& tagName, Document* document, bool)
451 {
452 return SVGStopElement::create(tagName, document);
453 }
454
styleConstructor(const QualifiedName & tagName,Document * document,bool createdByParser)455 static PassRefPtr<SVGElement> styleConstructor(const QualifiedName& tagName, Document* document, bool createdByParser)
456 {
457 return SVGStyleElement::create(tagName, document, createdByParser);
458 }
459
svgConstructor(const QualifiedName & tagName,Document * document,bool)460 static PassRefPtr<SVGElement> svgConstructor(const QualifiedName& tagName, Document* document, bool)
461 {
462 return SVGSVGElement::create(tagName, document);
463 }
464
switchConstructor(const QualifiedName & tagName,Document * document,bool)465 static PassRefPtr<SVGElement> switchConstructor(const QualifiedName& tagName, Document* document, bool)
466 {
467 return SVGSwitchElement::create(tagName, document);
468 }
469
symbolConstructor(const QualifiedName & tagName,Document * document,bool)470 static PassRefPtr<SVGElement> symbolConstructor(const QualifiedName& tagName, Document* document, bool)
471 {
472 return SVGSymbolElement::create(tagName, document);
473 }
474
textConstructor(const QualifiedName & tagName,Document * document,bool)475 static PassRefPtr<SVGElement> textConstructor(const QualifiedName& tagName, Document* document, bool)
476 {
477 return SVGTextElement::create(tagName, document);
478 }
479
textpathConstructor(const QualifiedName & tagName,Document * document,bool)480 static PassRefPtr<SVGElement> textpathConstructor(const QualifiedName& tagName, Document* document, bool)
481 {
482 return SVGTextPathElement::create(tagName, document);
483 }
484
titleConstructor(const QualifiedName & tagName,Document * document,bool)485 static PassRefPtr<SVGElement> titleConstructor(const QualifiedName& tagName, Document* document, bool)
486 {
487 return SVGTitleElement::create(tagName, document);
488 }
489
trefConstructor(const QualifiedName & tagName,Document * document,bool)490 static PassRefPtr<SVGElement> trefConstructor(const QualifiedName& tagName, Document* document, bool)
491 {
492 return SVGTRefElement::create(tagName, document);
493 }
494
tspanConstructor(const QualifiedName & tagName,Document * document,bool)495 static PassRefPtr<SVGElement> tspanConstructor(const QualifiedName& tagName, Document* document, bool)
496 {
497 return SVGTSpanElement::create(tagName, document);
498 }
499
useConstructor(const QualifiedName & tagName,Document * document,bool)500 static PassRefPtr<SVGElement> useConstructor(const QualifiedName& tagName, Document* document, bool)
501 {
502 return SVGUseElement::create(tagName, document);
503 }
504
viewConstructor(const QualifiedName & tagName,Document * document,bool)505 static PassRefPtr<SVGElement> viewConstructor(const QualifiedName& tagName, Document* document, bool)
506 {
507 return SVGViewElement::create(tagName, document);
508 }
509
vkernConstructor(const QualifiedName & tagName,Document * document,bool)510 static PassRefPtr<SVGElement> vkernConstructor(const QualifiedName& tagName, Document* document, bool)
511 {
512 return SVGVKernElement::create(tagName, document);
513 }
514
addTag(const QualifiedName & tag,ConstructorFunction func)515 static void addTag(const QualifiedName& tag, ConstructorFunction func)
516 {
517 gFunctionMap->set(tag.localName().impl(), func);
518 }
519
createFunctionMap()520 static void createFunctionMap()
521 {
522 ASSERT(!gFunctionMap);
523
524 // Create the table.
525 gFunctionMap = new FunctionMap;
526
527 // Populate it with constructor functions.
528 addTag(aTag, aConstructor);
529 addTag(altGlyphTag, altglyphConstructor);
530 addTag(animateTag, animateConstructor);
531 addTag(animateColorTag, animatecolorConstructor);
532 addTag(animateMotionTag, animatemotionConstructor);
533 addTag(animateTransformTag, animatetransformConstructor);
534 addTag(circleTag, circleConstructor);
535 addTag(clipPathTag, clippathConstructor);
536 addTag(cursorTag, cursorConstructor);
537 addTag(defsTag, defsConstructor);
538 addTag(descTag, descConstructor);
539 addTag(ellipseTag, ellipseConstructor);
540 addTag(feBlendTag, feblendConstructor);
541 addTag(feColorMatrixTag, fecolormatrixConstructor);
542 addTag(feComponentTransferTag, fecomponenttransferConstructor);
543 addTag(feCompositeTag, fecompositeConstructor);
544 addTag(feConvolveMatrixTag, feconvolvematrixConstructor);
545 addTag(feDiffuseLightingTag, fediffuselightingConstructor);
546 addTag(feDisplacementMapTag, fedisplacementmapConstructor);
547 addTag(feDistantLightTag, fedistantlightConstructor);
548 addTag(feDropShadowTag, fedropshadowConstructor);
549 addTag(feFloodTag, fefloodConstructor);
550 addTag(feFuncATag, fefuncaConstructor);
551 addTag(feFuncBTag, fefuncbConstructor);
552 addTag(feFuncGTag, fefuncgConstructor);
553 addTag(feFuncRTag, fefuncrConstructor);
554 addTag(feGaussianBlurTag, fegaussianblurConstructor);
555 addTag(feImageTag, feimageConstructor);
556 addTag(feMergeTag, femergeConstructor);
557 addTag(feMergeNodeTag, femergenodeConstructor);
558 addTag(feMorphologyTag, femorphologyConstructor);
559 addTag(feOffsetTag, feoffsetConstructor);
560 addTag(fePointLightTag, fepointlightConstructor);
561 addTag(feSpecularLightingTag, fespecularlightingConstructor);
562 addTag(feSpotLightTag, fespotlightConstructor);
563 addTag(feTileTag, fetileConstructor);
564 addTag(feTurbulenceTag, feturbulenceConstructor);
565 addTag(filterTag, filterConstructor);
566 addTag(fontTag, fontConstructor);
567 addTag(font_faceTag, fontfaceConstructor);
568 addTag(font_face_formatTag, fontfaceformatConstructor);
569 addTag(font_face_nameTag, fontfacenameConstructor);
570 addTag(font_face_srcTag, fontfacesrcConstructor);
571 addTag(font_face_uriTag, fontfaceuriConstructor);
572 addTag(foreignObjectTag, foreignobjectConstructor);
573 addTag(gTag, gConstructor);
574 addTag(glyphTag, glyphConstructor);
575 addTag(hkernTag, hkernConstructor);
576 addTag(imageTag, imageConstructor);
577 addTag(lineTag, lineConstructor);
578 addTag(linearGradientTag, lineargradientConstructor);
579 addTag(markerTag, markerConstructor);
580 addTag(maskTag, maskConstructor);
581 addTag(metadataTag, metadataConstructor);
582 addTag(missing_glyphTag, missingglyphConstructor);
583 addTag(mpathTag, mpathConstructor);
584 addTag(pathTag, pathConstructor);
585 addTag(patternTag, patternConstructor);
586 addTag(polygonTag, polygonConstructor);
587 addTag(polylineTag, polylineConstructor);
588 addTag(radialGradientTag, radialgradientConstructor);
589 addTag(rectTag, rectConstructor);
590 addTag(scriptTag, scriptConstructor);
591 addTag(setTag, setConstructor);
592 addTag(stopTag, stopConstructor);
593 addTag(styleTag, styleConstructor);
594 addTag(svgTag, svgConstructor);
595 addTag(switchTag, switchConstructor);
596 addTag(symbolTag, symbolConstructor);
597 addTag(textTag, textConstructor);
598 addTag(textPathTag, textpathConstructor);
599 addTag(titleTag, titleConstructor);
600 addTag(trefTag, trefConstructor);
601 addTag(tspanTag, tspanConstructor);
602 addTag(useTag, useConstructor);
603 addTag(viewTag, viewConstructor);
604 addTag(vkernTag, vkernConstructor);
605 }
606
createSVGElement(const QualifiedName & qName,Document * document,bool createdByParser)607 PassRefPtr<SVGElement> SVGElementFactory::createSVGElement(const QualifiedName& qName, Document* document, bool createdByParser)
608 {
609 if (!document)
610 return 0;
611
612 #if ENABLE(DASHBOARD_SUPPORT)
613 Settings* settings = document->settings();
614 if (settings && settings->usesDashboardBackwardCompatibilityMode())
615 return 0;
616 #endif
617 if (!gFunctionMap)
618 createFunctionMap();
619 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl()))
620 return function(qName, document, createdByParser);
621 return SVGElement::create(qName, document);
622 }
623
624 } // namespace WebCore
625
626 #endif
627