mshtml: Use designated initializers in node vtables.
[wine.git] / dlls / mshtml / svg.c
blob5fb83fd359703932757ff7d06f660ae4f27a91d1
1 /*
2 * Copyright 2019 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <math.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "winreg.h"
28 #include "ole2.h"
29 #include "mshtmdid.h"
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 struct SVGElement {
38 HTMLElement element;
39 ISVGElement ISVGElement_iface;
42 static inline SVGElement *impl_from_ISVGElement(ISVGElement *iface)
44 return CONTAINING_RECORD(iface, SVGElement, ISVGElement_iface);
47 static HRESULT WINAPI SVGElement_QueryInterface(ISVGElement *iface,
48 REFIID riid, void **ppv)
50 SVGElement *This = impl_from_ISVGElement(iface);
52 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
55 static ULONG WINAPI SVGElement_AddRef(ISVGElement *iface)
57 SVGElement *This = impl_from_ISVGElement(iface);
59 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
62 static ULONG WINAPI SVGElement_Release(ISVGElement *iface)
64 SVGElement *This = impl_from_ISVGElement(iface);
66 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
69 static HRESULT WINAPI SVGElement_GetTypeInfoCount(ISVGElement *iface, UINT *pctinfo)
71 SVGElement *This = impl_from_ISVGElement(iface);
72 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
75 static HRESULT WINAPI SVGElement_GetTypeInfo(ISVGElement *iface, UINT iTInfo,
76 LCID lcid, ITypeInfo **ppTInfo)
78 SVGElement *This = impl_from_ISVGElement(iface);
79 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
80 ppTInfo);
83 static HRESULT WINAPI SVGElement_GetIDsOfNames(ISVGElement *iface, REFIID riid,
84 LPOLESTR *rgszNames, UINT cNames,
85 LCID lcid, DISPID *rgDispId)
87 SVGElement *This = impl_from_ISVGElement(iface);
88 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
89 cNames, lcid, rgDispId);
92 static HRESULT WINAPI SVGElement_Invoke(ISVGElement *iface, DISPID dispIdMember,
93 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
94 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
96 SVGElement *This = impl_from_ISVGElement(iface);
97 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
98 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
101 static HRESULT WINAPI SVGElement_put_xmlbase(ISVGElement *iface, BSTR v)
103 SVGElement *This = impl_from_ISVGElement(iface);
104 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
105 return E_NOTIMPL;
108 static HRESULT WINAPI SVGElement_get_xmlbase(ISVGElement *iface, BSTR *p)
110 SVGElement *This = impl_from_ISVGElement(iface);
111 FIXME("(%p)->(%p)\n", This, p);
112 return E_NOTIMPL;
115 static HRESULT WINAPI SVGElement_putref_ownerSVGElement(ISVGElement *iface, ISVGSVGElement *v)
117 SVGElement *This = impl_from_ISVGElement(iface);
118 FIXME("(%p)->(%p)\n", This, v);
119 return E_NOTIMPL;
122 static HRESULT WINAPI SVGElement_get_ownerSVGElement(ISVGElement *iface, ISVGSVGElement **p)
124 SVGElement *This = impl_from_ISVGElement(iface);
125 FIXME("(%p)->(%p)\n", This, p);
126 return E_NOTIMPL;
129 static HRESULT WINAPI SVGElement_putref_viewportElement(ISVGElement *iface, ISVGElement *v)
131 SVGElement *This = impl_from_ISVGElement(iface);
132 FIXME("(%p)->(%p)\n", This, v);
133 return E_NOTIMPL;
136 static HRESULT WINAPI SVGElement_get_viewportElement(ISVGElement *iface, ISVGElement **p)
138 SVGElement *This = impl_from_ISVGElement(iface);
139 FIXME("(%p)->(%p)\n", This, p);
140 return E_NOTIMPL;
143 static HRESULT WINAPI SVGElement_putref_focusable(ISVGElement *iface, ISVGAnimatedEnumeration *v)
145 SVGElement *This = impl_from_ISVGElement(iface);
146 FIXME("(%p)->(%p)\n", This, v);
147 return E_NOTIMPL;
150 static HRESULT WINAPI SVGElement_get_focusable(ISVGElement *iface, ISVGAnimatedEnumeration **p)
152 SVGElement *This = impl_from_ISVGElement(iface);
153 FIXME("(%p)->(%p)\n", This, p);
154 return E_NOTIMPL;
157 static const ISVGElementVtbl SVGElementVtbl = {
158 SVGElement_QueryInterface,
159 SVGElement_AddRef,
160 SVGElement_Release,
161 SVGElement_GetTypeInfoCount,
162 SVGElement_GetTypeInfo,
163 SVGElement_GetIDsOfNames,
164 SVGElement_Invoke,
165 SVGElement_put_xmlbase,
166 SVGElement_get_xmlbase,
167 SVGElement_putref_ownerSVGElement,
168 SVGElement_get_ownerSVGElement,
169 SVGElement_putref_viewportElement,
170 SVGElement_get_viewportElement,
171 SVGElement_putref_focusable,
172 SVGElement_get_focusable
175 static inline SVGElement *SVGElement_from_HTMLDOMNode(HTMLDOMNode *iface)
177 return CONTAINING_RECORD(iface, SVGElement, element.node);
180 static HRESULT SVGElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
182 SVGElement *This = SVGElement_from_HTMLDOMNode(iface);
184 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
186 if(IsEqualGUID(&IID_ISVGElement, riid))
187 *ppv = &This->ISVGElement_iface;
188 else
189 return HTMLElement_QI(&This->element.node, riid, ppv);
191 IUnknown_AddRef((IUnknown*)*ppv);
192 return S_OK;
195 static const NodeImplVtbl SVGElementImplVtbl = {
196 .clsid = &CLSID_SVGElement,
197 .qi = SVGElement_QI,
198 .destructor = HTMLElement_destructor,
199 .cpc_entries = HTMLElement_cpc,
200 .clone = HTMLElement_clone,
201 .get_attr_col = HTMLElement_get_attr_col,
204 static void init_svg_element(SVGElement *svg_element, HTMLDocumentNode *doc, nsIDOMSVGElement *nselem)
206 if(!svg_element->element.node.vtbl)
207 svg_element->element.node.vtbl = &SVGElementImplVtbl;
208 svg_element->ISVGElement_iface.lpVtbl = &SVGElementVtbl;
209 HTMLElement_Init(&svg_element->element, doc, (nsIDOMElement*)nselem, NULL);
212 struct SVGSVGElement {
213 SVGElement svg_element;
214 ISVGSVGElement ISVGSVGElement_iface;
217 static inline SVGSVGElement *impl_from_ISVGSVGElement(ISVGSVGElement *iface)
219 return CONTAINING_RECORD(iface, SVGSVGElement, ISVGSVGElement_iface);
222 static HRESULT WINAPI SVGSVGElement_QueryInterface(ISVGSVGElement *iface,
223 REFIID riid, void **ppv)
225 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
227 return IHTMLDOMNode_QueryInterface(&This->svg_element.element.node.IHTMLDOMNode_iface, riid, ppv);
230 static ULONG WINAPI SVGSVGElement_AddRef(ISVGSVGElement *iface)
232 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
234 return IHTMLDOMNode_AddRef(&This->svg_element.element.node.IHTMLDOMNode_iface);
237 static ULONG WINAPI SVGSVGElement_Release(ISVGSVGElement *iface)
239 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
241 return IHTMLDOMNode_Release(&This->svg_element.element.node.IHTMLDOMNode_iface);
244 static HRESULT WINAPI SVGSVGElement_GetTypeInfoCount(ISVGSVGElement *iface, UINT *pctinfo)
246 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
247 return IDispatchEx_GetTypeInfoCount(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
250 static HRESULT WINAPI SVGSVGElement_GetTypeInfo(ISVGSVGElement *iface, UINT iTInfo,
251 LCID lcid, ITypeInfo **ppTInfo)
253 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
254 return IDispatchEx_GetTypeInfo(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
255 ppTInfo);
258 static HRESULT WINAPI SVGSVGElement_GetIDsOfNames(ISVGSVGElement *iface, REFIID riid,
259 LPOLESTR *rgszNames, UINT cNames,
260 LCID lcid, DISPID *rgDispId)
262 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
263 return IDispatchEx_GetIDsOfNames(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
264 cNames, lcid, rgDispId);
267 static HRESULT WINAPI SVGSVGElement_Invoke(ISVGSVGElement *iface, DISPID dispIdMember,
268 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
269 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
271 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
272 return IDispatchEx_Invoke(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
273 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
276 static HRESULT WINAPI SVGSVGElement_putref_x(ISVGSVGElement *iface, ISVGAnimatedLength *v)
278 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
279 FIXME("(%p)->(%p)\n", This, v);
280 return E_NOTIMPL;
283 static HRESULT WINAPI SVGSVGElement_get_x(ISVGSVGElement *iface, ISVGAnimatedLength **p)
285 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
286 FIXME("(%p)->(%p)\n", This, p);
287 return E_NOTIMPL;
290 static HRESULT WINAPI SVGSVGElement_putref_y(ISVGSVGElement *iface, ISVGAnimatedLength *v)
292 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
293 FIXME("(%p)->(%p)\n", This, v);
294 return E_NOTIMPL;
297 static HRESULT WINAPI SVGSVGElement_get_y(ISVGSVGElement *iface, ISVGAnimatedLength **p)
299 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
300 FIXME("(%p)->(%p)\n", This, p);
301 return E_NOTIMPL;
304 static HRESULT WINAPI SVGSVGElement_putref_width(ISVGSVGElement *iface, ISVGAnimatedLength *v)
306 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
307 FIXME("(%p)->(%p)\n", This, v);
308 return E_NOTIMPL;
311 static HRESULT WINAPI SVGSVGElement_get_width(ISVGSVGElement *iface, ISVGAnimatedLength **p)
313 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
314 FIXME("(%p)->(%p)\n", This, p);
315 return E_NOTIMPL;
318 static HRESULT WINAPI SVGSVGElement_putref_height(ISVGSVGElement *iface, ISVGAnimatedLength *v)
320 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
321 FIXME("(%p)->(%p)\n", This, v);
322 return E_NOTIMPL;
325 static HRESULT WINAPI SVGSVGElement_get_height(ISVGSVGElement *iface, ISVGAnimatedLength **p)
327 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
328 FIXME("(%p)->(%p)\n", This, p);
329 return E_NOTIMPL;
332 static HRESULT WINAPI SVGSVGElement_put_contentScriptType(ISVGSVGElement *iface, BSTR v)
334 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
335 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
336 return E_NOTIMPL;
339 static HRESULT WINAPI SVGSVGElement_get_contentScriptType(ISVGSVGElement *iface, BSTR *p)
341 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
342 FIXME("(%p)->(%p)\n", This, p);
343 return E_NOTIMPL;
346 static HRESULT WINAPI SVGSVGElement_put_contentStyleType(ISVGSVGElement *iface, BSTR v)
348 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
349 FIXME("(%p)->(%p)\n", This, v);
350 return E_NOTIMPL;
353 static HRESULT WINAPI SVGSVGElement_get_contentStyleType(ISVGSVGElement *iface, BSTR *p)
355 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
356 FIXME("(%p)->(%p)\n", This, p);
357 return E_NOTIMPL;
360 static HRESULT WINAPI SVGSVGElement_putref_viewport(ISVGSVGElement *iface, ISVGRect *v)
362 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
363 FIXME("(%p)->(%p)\n", This, v);
364 return E_NOTIMPL;
367 static HRESULT WINAPI SVGSVGElement_get_viewport(ISVGSVGElement *iface, ISVGRect **p)
369 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
370 FIXME("(%p)->(%p)\n", This, p);
371 return E_NOTIMPL;
374 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterX(ISVGSVGElement *iface, float v)
376 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
377 FIXME("(%p)->(%f)\n", This, v);
378 return E_NOTIMPL;
381 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterX(ISVGSVGElement *iface, float *p)
383 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
384 FIXME("(%p)->(%p)\n", This, p);
385 return E_NOTIMPL;
388 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterY(ISVGSVGElement *iface, float v)
390 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
391 FIXME("(%p)->(%f)\n", This, v);
392 return E_NOTIMPL;
395 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterY(ISVGSVGElement *iface, float *p)
397 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
398 FIXME("(%p)->(%p)\n", This, p);
399 return E_NOTIMPL;
402 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterX(ISVGSVGElement *iface, float v)
404 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
405 FIXME("(%p)->(%f)\n", This, v);
406 return E_NOTIMPL;
409 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterX(ISVGSVGElement *iface, float *p)
411 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
412 FIXME("(%p)->(%p)\n", This, p);
413 return E_NOTIMPL;
416 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterY(ISVGSVGElement *iface, float v)
418 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
419 FIXME("(%p)->(%f)\n", This, v);
420 return E_NOTIMPL;
423 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterY(ISVGSVGElement *iface, float *p)
425 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
426 FIXME("(%p)->(%p)\n", This, p);
427 return E_NOTIMPL;
430 static HRESULT WINAPI SVGSVGElement_put_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL v)
432 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
433 FIXME("(%p)->(%x)\n", This, v);
434 return E_NOTIMPL;
437 static HRESULT WINAPI SVGSVGElement_get_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL *p)
439 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
440 FIXME("(%p)->(%p)\n", This, p);
441 return E_NOTIMPL;
444 static HRESULT WINAPI SVGSVGElement_putref_currentView(ISVGSVGElement *iface, ISVGViewSpec *v)
446 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
447 FIXME("(%p)->(%p)\n", This, v);
448 return E_NOTIMPL;
451 static HRESULT WINAPI SVGSVGElement_get_currentView(ISVGSVGElement *iface, ISVGViewSpec **p)
453 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
454 FIXME("(%p)->(%p)\n", This, p);
455 return E_NOTIMPL;
458 static HRESULT WINAPI SVGSVGElement_put_currentScale(ISVGSVGElement *iface, float v)
460 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
461 FIXME("(%p)->(%f)\n", This, v);
462 return E_NOTIMPL;
465 static HRESULT WINAPI SVGSVGElement_get_currentScale(ISVGSVGElement *iface, float *p)
467 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
468 FIXME("(%p)->(%p)\n", This, p);
469 return E_NOTIMPL;
472 static HRESULT WINAPI SVGSVGElement_putref_currentTranslate(ISVGSVGElement *iface, ISVGPoint *v)
474 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
475 FIXME("(%p)->(%p)\n", This, v);
476 return E_NOTIMPL;
479 static HRESULT WINAPI SVGSVGElement_get_currentTranslate(ISVGSVGElement *iface, ISVGPoint **p)
481 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
482 FIXME("(%p)->(%p)\n", This, p);
483 return E_NOTIMPL;
486 static HRESULT WINAPI SVGSVGElement_suspendRedraw(ISVGSVGElement *iface, ULONG max_wait, ULONG *p)
488 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
489 FIXME("(%p)->(%lu %p)\n", This, max_wait, p);
490 return E_NOTIMPL;
493 static HRESULT WINAPI SVGSVGElement_unsuspendRedraw(ISVGSVGElement *iface, ULONG id)
495 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
496 FIXME("(%p)->(%lu)\n", This, id);
497 return E_NOTIMPL;
500 static HRESULT WINAPI SVGSVGElement_unsuspendRedrawAll(ISVGSVGElement *iface)
502 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
503 FIXME("(%p)\n", This);
504 return E_NOTIMPL;
507 static HRESULT WINAPI SVGSVGElement_forceRedraw(ISVGSVGElement *iface)
509 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
510 FIXME("(%p)\n", This);
511 return E_NOTIMPL;
514 static HRESULT WINAPI SVGSVGElement_pauseAnimations(ISVGSVGElement *iface)
516 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
517 FIXME("(%p)\n", This);
518 return E_NOTIMPL;
521 static HRESULT WINAPI SVGSVGElement_unpauseAnimations(ISVGSVGElement *iface)
523 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
524 FIXME("(%p)\n", This);
525 return E_NOTIMPL;
528 static HRESULT WINAPI SVGSVGElement_animationsPaused(ISVGSVGElement *iface, VARIANT_BOOL *p)
530 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
531 FIXME("(%p)->(%p)\n", This, p);
532 return E_NOTIMPL;
535 static HRESULT WINAPI SVGSVGElement_getCurrentTime(ISVGSVGElement *iface, float *p)
537 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
538 FIXME("(%p)->(%p)\n", This, p);
539 return E_NOTIMPL;
542 static HRESULT WINAPI SVGSVGElement_setCurrentTime(ISVGSVGElement *iface, float v)
544 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
545 FIXME("(%p)->(%f)\n", This, v);
546 return E_NOTIMPL;
549 static HRESULT WINAPI SVGSVGElement_getIntersectionList(ISVGSVGElement *iface, ISVGRect *rect,
550 ISVGElement *reference_element, VARIANT *p)
552 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
553 FIXME("(%p)->(%p %p %p)\n", This, rect, reference_element, p);
554 return E_NOTIMPL;
557 static HRESULT WINAPI SVGSVGElement_getEnclosureList(ISVGSVGElement *iface, ISVGRect *rect,
558 ISVGElement *reference_element, VARIANT *p)
560 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
561 FIXME("(%p)->()\n", This);
562 return E_NOTIMPL;
565 static HRESULT WINAPI SVGSVGElement_checkIntersection(ISVGSVGElement *iface, ISVGElement *element,
566 ISVGRect *rect, VARIANT_BOOL *p)
568 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
569 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
570 return E_NOTIMPL;
573 static HRESULT WINAPI SVGSVGElement_checkEnclosure(ISVGSVGElement *iface, ISVGElement *element,
574 ISVGRect *rect, VARIANT_BOOL *p)
576 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
577 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
578 return E_NOTIMPL;
581 static HRESULT WINAPI SVGSVGElement_deselectAll(ISVGSVGElement *iface)
583 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
584 FIXME("(%p)\n", This);
585 return E_NOTIMPL;
588 static HRESULT WINAPI SVGSVGElement_createSVGNumber(ISVGSVGElement *iface, ISVGNumber **p)
590 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
591 FIXME("(%p)->(%p)\n", This, p);
592 return E_NOTIMPL;
595 static HRESULT WINAPI SVGSVGElement_createSVGLength(ISVGSVGElement *iface, ISVGLength **p)
597 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
598 FIXME("(%p)->(%p)\n", This, p);
599 return E_NOTIMPL;
602 static HRESULT WINAPI SVGSVGElement_createSVGAngle(ISVGSVGElement *iface, ISVGAngle **p)
604 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
605 FIXME("(%p)->(%p)\n", This, p);
606 return E_NOTIMPL;
609 static HRESULT WINAPI SVGSVGElement_createSVGPoint(ISVGSVGElement *iface, ISVGPoint **p)
611 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
612 FIXME("(%p)->(%p)\n", This, p);
613 return E_NOTIMPL;
616 static HRESULT WINAPI SVGSVGElement_createSVGMatrix(ISVGSVGElement *iface, ISVGMatrix **p)
618 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
619 FIXME("(%p)->(%p)\n", This, p);
620 return E_NOTIMPL;
623 static HRESULT WINAPI SVGSVGElement_createSVGRect(ISVGSVGElement *iface, ISVGRect **p)
625 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
626 FIXME("(%p)->(%p)\n", This, p);
627 return E_NOTIMPL;
630 static HRESULT WINAPI SVGSVGElement_createSVGTransform(ISVGSVGElement *iface, ISVGTransform **p)
632 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
633 FIXME("(%p)->(%p)\n", This, p);
634 return E_NOTIMPL;
637 static HRESULT WINAPI SVGSVGElement_createSVGTransformFromMatrix(ISVGSVGElement *iface,
638 ISVGMatrix *matrix, ISVGTransform **p)
640 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
641 FIXME("(%p)->(%p %p)\n", This, matrix, p);
642 return E_NOTIMPL;
645 static HRESULT WINAPI SVGSVGElement_getElementById(ISVGSVGElement *iface, BSTR id, IHTMLElement **p)
647 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
648 FIXME("(%p)->(%s %p)\n", This, debugstr_w(id), p);
649 return E_NOTIMPL;
652 static const ISVGSVGElementVtbl SVGSVGElementVtbl = {
653 SVGSVGElement_QueryInterface,
654 SVGSVGElement_AddRef,
655 SVGSVGElement_Release,
656 SVGSVGElement_GetTypeInfoCount,
657 SVGSVGElement_GetTypeInfo,
658 SVGSVGElement_GetIDsOfNames,
659 SVGSVGElement_Invoke,
660 SVGSVGElement_putref_x,
661 SVGSVGElement_get_x,
662 SVGSVGElement_putref_y,
663 SVGSVGElement_get_y,
664 SVGSVGElement_putref_width,
665 SVGSVGElement_get_width,
666 SVGSVGElement_putref_height,
667 SVGSVGElement_get_height,
668 SVGSVGElement_put_contentScriptType,
669 SVGSVGElement_get_contentScriptType,
670 SVGSVGElement_put_contentStyleType,
671 SVGSVGElement_get_contentStyleType,
672 SVGSVGElement_putref_viewport,
673 SVGSVGElement_get_viewport,
674 SVGSVGElement_put_pixelUnitToMillimeterX,
675 SVGSVGElement_get_pixelUnitToMillimeterX,
676 SVGSVGElement_put_pixelUnitToMillimeterY,
677 SVGSVGElement_get_pixelUnitToMillimeterY,
678 SVGSVGElement_put_screenPixelToMillimeterX,
679 SVGSVGElement_get_screenPixelToMillimeterX,
680 SVGSVGElement_put_screenPixelToMillimeterY,
681 SVGSVGElement_get_screenPixelToMillimeterY,
682 SVGSVGElement_put_useCurrentView,
683 SVGSVGElement_get_useCurrentView,
684 SVGSVGElement_putref_currentView,
685 SVGSVGElement_get_currentView,
686 SVGSVGElement_put_currentScale,
687 SVGSVGElement_get_currentScale,
688 SVGSVGElement_putref_currentTranslate,
689 SVGSVGElement_get_currentTranslate,
690 SVGSVGElement_suspendRedraw,
691 SVGSVGElement_unsuspendRedraw,
692 SVGSVGElement_unsuspendRedrawAll,
693 SVGSVGElement_forceRedraw,
694 SVGSVGElement_pauseAnimations,
695 SVGSVGElement_unpauseAnimations,
696 SVGSVGElement_animationsPaused,
697 SVGSVGElement_getCurrentTime,
698 SVGSVGElement_setCurrentTime,
699 SVGSVGElement_getIntersectionList,
700 SVGSVGElement_getEnclosureList,
701 SVGSVGElement_checkIntersection,
702 SVGSVGElement_checkEnclosure,
703 SVGSVGElement_deselectAll,
704 SVGSVGElement_createSVGNumber,
705 SVGSVGElement_createSVGLength,
706 SVGSVGElement_createSVGAngle,
707 SVGSVGElement_createSVGPoint,
708 SVGSVGElement_createSVGMatrix,
709 SVGSVGElement_createSVGRect,
710 SVGSVGElement_createSVGTransform,
711 SVGSVGElement_createSVGTransformFromMatrix,
712 SVGSVGElement_getElementById
715 static inline SVGSVGElement *SVGSVGElement_from_HTMLDOMNode(HTMLDOMNode *iface)
717 return CONTAINING_RECORD(iface, SVGSVGElement, svg_element.element.node);
720 static HRESULT SVGSVGElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
722 SVGSVGElement *This = SVGSVGElement_from_HTMLDOMNode(iface);
724 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
726 if(IsEqualGUID(&IID_ISVGSVGElement, riid))
727 *ppv = &This->ISVGSVGElement_iface;
728 else
729 return SVGElement_QI(&This->svg_element.element.node, riid, ppv);
731 IUnknown_AddRef((IUnknown*)*ppv);
732 return S_OK;
735 static const NodeImplVtbl SVGSVGElementImplVtbl = {
736 .clsid = &CLSID_SVGSVGElement,
737 .qi = SVGSVGElement_QI,
738 .destructor = HTMLElement_destructor,
739 .cpc_entries = HTMLElement_cpc,
740 .clone = HTMLElement_clone,
741 .get_attr_col = HTMLElement_get_attr_col,
744 static HRESULT create_viewport_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
746 SVGSVGElement *ret;
748 ret = calloc(1, sizeof(SVGSVGElement));
749 if(!ret)
750 return E_OUTOFMEMORY;
752 ret->ISVGSVGElement_iface.lpVtbl = &SVGSVGElementVtbl;
753 ret->svg_element.element.node.vtbl = &SVGSVGElementImplVtbl;
755 init_svg_element(&ret->svg_element, doc, nselem);
757 *elem = &ret->svg_element.element;
758 return S_OK;
761 struct SVGCircleElement {
762 SVGElement svg_element;
763 ISVGCircleElement ISVGCircleElement_iface;
766 static inline SVGCircleElement *impl_from_ISVGCircleElement(ISVGCircleElement *iface)
768 return CONTAINING_RECORD(iface, SVGCircleElement, ISVGCircleElement_iface);
771 static HRESULT WINAPI SVGCircleElement_QueryInterface(ISVGCircleElement *iface,
772 REFIID riid, void **ppv)
774 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
776 return IHTMLDOMNode_QueryInterface(&This->svg_element.element.node.IHTMLDOMNode_iface, riid, ppv);
779 static ULONG WINAPI SVGCircleElement_AddRef(ISVGCircleElement *iface)
781 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
783 return IHTMLDOMNode_AddRef(&This->svg_element.element.node.IHTMLDOMNode_iface);
786 static ULONG WINAPI SVGCircleElement_Release(ISVGCircleElement *iface)
788 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
790 return IHTMLDOMNode_Release(&This->svg_element.element.node.IHTMLDOMNode_iface);
793 static HRESULT WINAPI SVGCircleElement_GetTypeInfoCount(ISVGCircleElement *iface, UINT *pctinfo)
795 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
796 return IDispatchEx_GetTypeInfoCount(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
799 static HRESULT WINAPI SVGCircleElement_GetTypeInfo(ISVGCircleElement *iface, UINT iTInfo,
800 LCID lcid, ITypeInfo **ppTInfo)
802 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
803 return IDispatchEx_GetTypeInfo(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
804 ppTInfo);
807 static HRESULT WINAPI SVGCircleElement_GetIDsOfNames(ISVGCircleElement *iface, REFIID riid,
808 LPOLESTR *rgszNames, UINT cNames,
809 LCID lcid, DISPID *rgDispId)
811 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
812 return IDispatchEx_GetIDsOfNames(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
813 cNames, lcid, rgDispId);
816 static HRESULT WINAPI SVGCircleElement_Invoke(ISVGCircleElement *iface, DISPID dispIdMember,
817 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
818 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
820 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
821 return IDispatchEx_Invoke(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
822 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
825 static HRESULT WINAPI SVGCircleElement_putref_cx(ISVGCircleElement *iface, ISVGAnimatedLength *v)
827 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
828 FIXME("(%p)->(%p)\n", This, v);
829 return E_NOTIMPL;
832 static HRESULT WINAPI SVGCircleElement_get_cx(ISVGCircleElement *iface, ISVGAnimatedLength **p)
834 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
835 FIXME("(%p)->(%p)\n", This, p);
836 return E_NOTIMPL;
839 static HRESULT WINAPI SVGCircleElement_putref_cy(ISVGCircleElement *iface, ISVGAnimatedLength *v)
841 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
842 FIXME("(%p)->(%p)\n", This, v);
843 return E_NOTIMPL;
846 static HRESULT WINAPI SVGCircleElement_get_cy(ISVGCircleElement *iface, ISVGAnimatedLength **p)
848 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
849 FIXME("(%p)->(%p)\n", This, p);
850 return E_NOTIMPL;
853 static HRESULT WINAPI SVGCircleElement_putref_r(ISVGCircleElement *iface, ISVGAnimatedLength *v)
855 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
856 FIXME("(%p)->(%p)\n", This, v);
857 return E_NOTIMPL;
860 static HRESULT WINAPI SVGCircleElement_get_r(ISVGCircleElement *iface, ISVGAnimatedLength **p)
862 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
863 FIXME("(%p)->(%p)\n", This, p);
864 return E_NOTIMPL;
867 static const ISVGCircleElementVtbl SVGCircleElementVtbl = {
868 SVGCircleElement_QueryInterface,
869 SVGCircleElement_AddRef,
870 SVGCircleElement_Release,
871 SVGCircleElement_GetTypeInfoCount,
872 SVGCircleElement_GetTypeInfo,
873 SVGCircleElement_GetIDsOfNames,
874 SVGCircleElement_Invoke,
875 SVGCircleElement_putref_cx,
876 SVGCircleElement_get_cx,
877 SVGCircleElement_putref_cy,
878 SVGCircleElement_get_cy,
879 SVGCircleElement_putref_r,
880 SVGCircleElement_get_r
883 static inline SVGCircleElement *SVGCircleElement_from_HTMLDOMNode(HTMLDOMNode *iface)
885 return CONTAINING_RECORD(iface, SVGCircleElement, svg_element.element.node);
888 static HRESULT SVGCircleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
890 SVGCircleElement *This = SVGCircleElement_from_HTMLDOMNode(iface);
892 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
894 if(IsEqualGUID(&IID_ISVGCircleElement, riid))
895 *ppv = &This->ISVGCircleElement_iface;
896 else
897 return SVGElement_QI(&This->svg_element.element.node, riid, ppv);
899 IUnknown_AddRef((IUnknown*)*ppv);
900 return S_OK;
903 static const NodeImplVtbl SVGCircleElementImplVtbl = {
904 .clsid = &CLSID_SVGCircleElement,
905 .qi = SVGCircleElement_QI,
906 .destructor = HTMLElement_destructor,
907 .cpc_entries = HTMLElement_cpc,
908 .clone = HTMLElement_clone,
909 .get_attr_col = HTMLElement_get_attr_col,
912 static HRESULT create_circle_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
914 SVGCircleElement *ret;
916 ret = calloc(1, sizeof(SVGCircleElement));
917 if(!ret)
918 return E_OUTOFMEMORY;
920 ret->ISVGCircleElement_iface.lpVtbl = &SVGCircleElementVtbl;
921 ret->svg_element.element.node.vtbl = &SVGCircleElementImplVtbl;
923 init_svg_element(&ret->svg_element, doc, nselem);
925 *elem = &ret->svg_element.element;
926 return S_OK;
929 typedef struct {
930 ISVGTextContentElement ISVGTextContentElement_iface;
931 SVGElement *svg_element;
932 } SVGTextContentElement;
934 static inline SVGTextContentElement *impl_from_ISVGTextContentElement(ISVGTextContentElement *iface)
936 return CONTAINING_RECORD(iface, SVGTextContentElement, ISVGTextContentElement_iface);
939 static HRESULT WINAPI SVGTextContentElement_QueryInterface(ISVGTextContentElement *iface,
940 REFIID riid, void **ppv)
942 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
943 return IHTMLDOMNode_QueryInterface(&This->svg_element->element.node.IHTMLDOMNode_iface, riid, ppv);
946 static ULONG WINAPI SVGTextContentElement_AddRef(ISVGTextContentElement *iface)
948 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
950 return IHTMLDOMNode_AddRef(&This->svg_element->element.node.IHTMLDOMNode_iface);
953 static ULONG WINAPI SVGTextContentElement_Release(ISVGTextContentElement *iface)
955 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
957 return IHTMLDOMNode_Release(&This->svg_element->element.node.IHTMLDOMNode_iface);
960 static HRESULT WINAPI SVGTextContentElement_GetTypeInfoCount(ISVGTextContentElement *iface, UINT *pctinfo)
962 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
963 return IDispatchEx_GetTypeInfoCount(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
966 static HRESULT WINAPI SVGTextContentElement_GetTypeInfo(ISVGTextContentElement *iface, UINT iTInfo,
967 LCID lcid, ITypeInfo **ppTInfo)
969 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
970 return IDispatchEx_GetTypeInfo(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
971 ppTInfo);
974 static HRESULT WINAPI SVGTextContentElement_GetIDsOfNames(ISVGTextContentElement *iface, REFIID riid,
975 LPOLESTR *rgszNames, UINT cNames,
976 LCID lcid, DISPID *rgDispId)
978 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
979 return IDispatchEx_GetIDsOfNames(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
980 cNames, lcid, rgDispId);
983 static HRESULT WINAPI SVGTextContentElement_Invoke(ISVGTextContentElement *iface, DISPID dispIdMember,
984 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
985 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
987 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
988 return IDispatchEx_Invoke(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
989 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
992 static HRESULT WINAPI SVGTextContentElement_putref_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength *v)
994 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
995 FIXME("(%p)->(%p)\n", This, v);
996 return E_NOTIMPL;
999 static HRESULT WINAPI SVGTextContentElement_get_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength **p)
1001 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1002 FIXME("(%p)->(%p)\n", This, p);
1003 return E_NOTIMPL;
1006 static HRESULT WINAPI SVGTextContentElement_putref_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration *v)
1008 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1009 FIXME("(%p)->(%p)\n", This, v);
1010 return E_NOTIMPL;
1013 static HRESULT WINAPI SVGTextContentElement_get_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration **p)
1015 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1016 FIXME("(%p)->(%p)\n", This, p);
1017 return E_NOTIMPL;
1020 static HRESULT WINAPI SVGTextContentElement_getNumberOfChars(ISVGTextContentElement *iface, LONG *p)
1022 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1023 FIXME("(%p)->(%p)\n", This, p);
1024 return E_NOTIMPL;
1027 static HRESULT WINAPI SVGTextContentElement_getComputedTextLength(ISVGTextContentElement *iface, float *p)
1029 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1030 FIXME("(%p)->(%p)\n", This, p);
1031 return E_NOTIMPL;
1034 static HRESULT WINAPI SVGTextContentElement_getSubStringLength(ISVGTextContentElement *iface,
1035 LONG charnum, LONG nchars, float *p)
1037 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1038 FIXME("(%p)->(%ld %ld %p)\n", This, charnum, nchars, p);
1039 return E_NOTIMPL;
1042 static HRESULT WINAPI SVGTextContentElement_getStartPositionOfChar(ISVGTextContentElement *iface,
1043 LONG charnum, ISVGPoint **p)
1045 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1046 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1047 return E_NOTIMPL;
1050 static HRESULT WINAPI SVGTextContentElement_getEndPositionOfChar(ISVGTextContentElement *iface,
1051 LONG charnum, ISVGPoint **p)
1053 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1054 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1055 return E_NOTIMPL;
1058 static HRESULT WINAPI SVGTextContentElement_getExtentOfChar(ISVGTextContentElement *iface,
1059 LONG charnum, ISVGRect **p)
1061 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1062 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1063 return E_NOTIMPL;
1066 static HRESULT WINAPI SVGTextContentElement_getRotationOfChar(ISVGTextContentElement *iface,
1067 LONG charnum, float *p)
1069 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1070 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1071 return E_NOTIMPL;
1074 static HRESULT WINAPI SVGTextContentElement_getCharNumAtPosition(ISVGTextContentElement *iface,
1075 ISVGPoint *point, LONG *p)
1077 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1078 FIXME("(%p)->(%p %p)\n", This, point, p);
1079 return E_NOTIMPL;
1082 static HRESULT WINAPI SVGTextContentElement_selectSubString(ISVGTextContentElement *iface,
1083 LONG charnum, LONG nchars)
1085 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1086 FIXME("(%p)->(%ld %ld)\n", This, charnum, nchars);
1087 return E_NOTIMPL;
1090 static const ISVGTextContentElementVtbl SVGTextContentElementVtbl = {
1091 SVGTextContentElement_QueryInterface,
1092 SVGTextContentElement_AddRef,
1093 SVGTextContentElement_Release,
1094 SVGTextContentElement_GetTypeInfoCount,
1095 SVGTextContentElement_GetTypeInfo,
1096 SVGTextContentElement_GetIDsOfNames,
1097 SVGTextContentElement_Invoke,
1098 SVGTextContentElement_putref_textLength,
1099 SVGTextContentElement_get_textLength,
1100 SVGTextContentElement_putref_lengthAdjust,
1101 SVGTextContentElement_get_lengthAdjust,
1102 SVGTextContentElement_getNumberOfChars,
1103 SVGTextContentElement_getComputedTextLength,
1104 SVGTextContentElement_getSubStringLength,
1105 SVGTextContentElement_getStartPositionOfChar,
1106 SVGTextContentElement_getEndPositionOfChar,
1107 SVGTextContentElement_getExtentOfChar,
1108 SVGTextContentElement_getRotationOfChar,
1109 SVGTextContentElement_getCharNumAtPosition,
1110 SVGTextContentElement_selectSubString
1113 static void init_text_content_element(SVGTextContentElement *text_content, SVGElement *svg_element)
1115 text_content->ISVGTextContentElement_iface.lpVtbl = &SVGTextContentElementVtbl;
1116 text_content->svg_element = svg_element;
1119 struct SVGTSpanElement {
1120 SVGElement svg_element;
1121 SVGTextContentElement text_content;
1124 static inline SVGTSpanElement *SVGTSpanElement_from_HTMLDOMNode(HTMLDOMNode *iface)
1126 return CONTAINING_RECORD(iface, SVGTSpanElement, svg_element.element.node);
1129 static HRESULT SVGTSpanElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1131 SVGTSpanElement *This = SVGTSpanElement_from_HTMLDOMNode(iface);
1133 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
1135 if(IsEqualGUID(&IID_ISVGTSpanElement, riid))
1136 *ppv = &This->svg_element.ISVGElement_iface; /* no additional methods */
1137 else if(IsEqualGUID(&IID_ISVGTextContentElement, riid))
1138 *ppv = &This->text_content.ISVGTextContentElement_iface;
1139 else
1140 return SVGElement_QI(&This->svg_element.element.node, riid, ppv);
1142 IUnknown_AddRef((IUnknown*)*ppv);
1143 return S_OK;
1146 static const NodeImplVtbl SVGTSpanElementImplVtbl = {
1147 .clsid = &CLSID_SVGTSpanElement,
1148 .qi = SVGTSpanElement_QI,
1149 .destructor = HTMLElement_destructor,
1150 .cpc_entries = HTMLElement_cpc,
1151 .clone = HTMLElement_clone,
1152 .get_attr_col = HTMLElement_get_attr_col,
1155 static HRESULT create_tspan_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
1157 SVGTSpanElement *ret;
1159 ret = calloc(1, sizeof(SVGTSpanElement));
1160 if(!ret)
1161 return E_OUTOFMEMORY;
1163 ret->svg_element.element.node.vtbl = &SVGTSpanElementImplVtbl;
1164 init_text_content_element(&ret->text_content, &ret->svg_element);
1165 init_svg_element(&ret->svg_element, doc, nselem);
1167 *elem = &ret->svg_element.element;
1168 return S_OK;
1171 HRESULT create_svg_element(HTMLDocumentNode *doc, nsIDOMSVGElement *dom_element, const WCHAR *tag_name, HTMLElement **elem)
1173 SVGElement *svg_element;
1175 TRACE("%s\n", debugstr_w(tag_name));
1177 if(!wcscmp(tag_name, L"svg"))
1178 return create_viewport_element(doc, dom_element, elem);
1179 if(!wcscmp(tag_name, L"circle"))
1180 return create_circle_element(doc, dom_element, elem);
1181 if(!wcscmp(tag_name, L"tspan"))
1182 return create_tspan_element(doc, dom_element, elem);
1184 svg_element = calloc(1, sizeof(*svg_element));
1185 if(!svg_element)
1186 return E_OUTOFMEMORY;
1188 init_svg_element(svg_element, doc, dom_element);
1189 *elem = &svg_element->element;
1190 return S_OK;