dmstyle: Rewrite style pref chunk parsing.
[wine.git] / dlls / mshtml / svg.c
blob1b9cf81c1cc4d0a6a8ead4f9d830591cb45e2e05
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"
34 #include "htmlevent.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 struct SVGElement {
39 HTMLElement element;
40 ISVGElement ISVGElement_iface;
43 static inline SVGElement *impl_from_ISVGElement(ISVGElement *iface)
45 return CONTAINING_RECORD(iface, SVGElement, ISVGElement_iface);
48 static HRESULT WINAPI SVGElement_QueryInterface(ISVGElement *iface,
49 REFIID riid, void **ppv)
51 SVGElement *This = impl_from_ISVGElement(iface);
53 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
56 static ULONG WINAPI SVGElement_AddRef(ISVGElement *iface)
58 SVGElement *This = impl_from_ISVGElement(iface);
60 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
63 static ULONG WINAPI SVGElement_Release(ISVGElement *iface)
65 SVGElement *This = impl_from_ISVGElement(iface);
67 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
70 static HRESULT WINAPI SVGElement_GetTypeInfoCount(ISVGElement *iface, UINT *pctinfo)
72 SVGElement *This = impl_from_ISVGElement(iface);
73 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
76 static HRESULT WINAPI SVGElement_GetTypeInfo(ISVGElement *iface, UINT iTInfo,
77 LCID lcid, ITypeInfo **ppTInfo)
79 SVGElement *This = impl_from_ISVGElement(iface);
80 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
81 ppTInfo);
84 static HRESULT WINAPI SVGElement_GetIDsOfNames(ISVGElement *iface, REFIID riid,
85 LPOLESTR *rgszNames, UINT cNames,
86 LCID lcid, DISPID *rgDispId)
88 SVGElement *This = impl_from_ISVGElement(iface);
89 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
90 cNames, lcid, rgDispId);
93 static HRESULT WINAPI SVGElement_Invoke(ISVGElement *iface, DISPID dispIdMember,
94 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
95 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
97 SVGElement *This = impl_from_ISVGElement(iface);
98 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
99 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
102 static HRESULT WINAPI SVGElement_put_xmlbase(ISVGElement *iface, BSTR v)
104 SVGElement *This = impl_from_ISVGElement(iface);
105 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
106 return E_NOTIMPL;
109 static HRESULT WINAPI SVGElement_get_xmlbase(ISVGElement *iface, BSTR *p)
111 SVGElement *This = impl_from_ISVGElement(iface);
112 FIXME("(%p)->(%p)\n", This, p);
113 return E_NOTIMPL;
116 static HRESULT WINAPI SVGElement_putref_ownerSVGElement(ISVGElement *iface, ISVGSVGElement *v)
118 SVGElement *This = impl_from_ISVGElement(iface);
119 FIXME("(%p)->(%p)\n", This, v);
120 return E_NOTIMPL;
123 static HRESULT WINAPI SVGElement_get_ownerSVGElement(ISVGElement *iface, ISVGSVGElement **p)
125 SVGElement *This = impl_from_ISVGElement(iface);
126 FIXME("(%p)->(%p)\n", This, p);
127 return E_NOTIMPL;
130 static HRESULT WINAPI SVGElement_putref_viewportElement(ISVGElement *iface, ISVGElement *v)
132 SVGElement *This = impl_from_ISVGElement(iface);
133 FIXME("(%p)->(%p)\n", This, v);
134 return E_NOTIMPL;
137 static HRESULT WINAPI SVGElement_get_viewportElement(ISVGElement *iface, ISVGElement **p)
139 SVGElement *This = impl_from_ISVGElement(iface);
140 FIXME("(%p)->(%p)\n", This, p);
141 return E_NOTIMPL;
144 static HRESULT WINAPI SVGElement_putref_focusable(ISVGElement *iface, ISVGAnimatedEnumeration *v)
146 SVGElement *This = impl_from_ISVGElement(iface);
147 FIXME("(%p)->(%p)\n", This, v);
148 return E_NOTIMPL;
151 static HRESULT WINAPI SVGElement_get_focusable(ISVGElement *iface, ISVGAnimatedEnumeration **p)
153 SVGElement *This = impl_from_ISVGElement(iface);
154 FIXME("(%p)->(%p)\n", This, p);
155 return E_NOTIMPL;
158 static const ISVGElementVtbl SVGElementVtbl = {
159 SVGElement_QueryInterface,
160 SVGElement_AddRef,
161 SVGElement_Release,
162 SVGElement_GetTypeInfoCount,
163 SVGElement_GetTypeInfo,
164 SVGElement_GetIDsOfNames,
165 SVGElement_Invoke,
166 SVGElement_put_xmlbase,
167 SVGElement_get_xmlbase,
168 SVGElement_putref_ownerSVGElement,
169 SVGElement_get_ownerSVGElement,
170 SVGElement_putref_viewportElement,
171 SVGElement_get_viewportElement,
172 SVGElement_putref_focusable,
173 SVGElement_get_focusable
176 static inline SVGElement *SVGElement_from_DispatchEx(DispatchEx *iface)
178 return CONTAINING_RECORD(iface, SVGElement, element.node.event_target.dispex);
181 static void *SVGElement_query_interface(DispatchEx *dispex, REFIID riid)
183 SVGElement *This = SVGElement_from_DispatchEx(dispex);
185 if(IsEqualGUID(&IID_ISVGElement, riid))
186 return &This->ISVGElement_iface;
188 return HTMLElement_query_interface(&This->element.node.event_target.dispex, riid);
191 static const NodeImplVtbl SVGElementImplVtbl = {
192 .clsid = &CLSID_SVGElement,
193 .cpc_entries = HTMLElement_cpc,
194 .clone = HTMLElement_clone,
195 .get_attr_col = HTMLElement_get_attr_col,
198 static const event_target_vtbl_t SVGElement_event_target_vtbl = {
200 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
201 .query_interface= SVGElement_query_interface,
202 .destructor = HTMLElement_destructor,
203 .traverse = HTMLDOMNode_traverse,
204 .unlink = HTMLDOMNode_unlink
206 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
207 .handle_event = HTMLElement_handle_event
210 static dispex_static_data_t SVGElement_dispex = {
211 "HTMLUnknownElement",
212 &SVGElement_event_target_vtbl.dispex_vtbl,
213 DispHTMLUnknownElement_tid,
214 HTMLElement_iface_tids,
215 HTMLElement_init_dispex_info
218 static void init_svg_element(SVGElement *svg_element, HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, dispex_static_data_t *dispex_data)
220 svg_element->ISVGElement_iface.lpVtbl = &SVGElementVtbl;
221 HTMLElement_Init(&svg_element->element, doc, (nsIDOMElement*)nselem, dispex_data);
224 struct SVGSVGElement {
225 SVGElement svg_element;
226 ISVGSVGElement ISVGSVGElement_iface;
229 static inline SVGSVGElement *impl_from_ISVGSVGElement(ISVGSVGElement *iface)
231 return CONTAINING_RECORD(iface, SVGSVGElement, ISVGSVGElement_iface);
234 static HRESULT WINAPI SVGSVGElement_QueryInterface(ISVGSVGElement *iface,
235 REFIID riid, void **ppv)
237 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
239 return IHTMLDOMNode_QueryInterface(&This->svg_element.element.node.IHTMLDOMNode_iface, riid, ppv);
242 static ULONG WINAPI SVGSVGElement_AddRef(ISVGSVGElement *iface)
244 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
246 return IHTMLDOMNode_AddRef(&This->svg_element.element.node.IHTMLDOMNode_iface);
249 static ULONG WINAPI SVGSVGElement_Release(ISVGSVGElement *iface)
251 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
253 return IHTMLDOMNode_Release(&This->svg_element.element.node.IHTMLDOMNode_iface);
256 static HRESULT WINAPI SVGSVGElement_GetTypeInfoCount(ISVGSVGElement *iface, UINT *pctinfo)
258 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
259 return IDispatchEx_GetTypeInfoCount(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
262 static HRESULT WINAPI SVGSVGElement_GetTypeInfo(ISVGSVGElement *iface, UINT iTInfo,
263 LCID lcid, ITypeInfo **ppTInfo)
265 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
266 return IDispatchEx_GetTypeInfo(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
267 ppTInfo);
270 static HRESULT WINAPI SVGSVGElement_GetIDsOfNames(ISVGSVGElement *iface, REFIID riid,
271 LPOLESTR *rgszNames, UINT cNames,
272 LCID lcid, DISPID *rgDispId)
274 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
275 return IDispatchEx_GetIDsOfNames(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
276 cNames, lcid, rgDispId);
279 static HRESULT WINAPI SVGSVGElement_Invoke(ISVGSVGElement *iface, DISPID dispIdMember,
280 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
281 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
283 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
284 return IDispatchEx_Invoke(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
285 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
288 static HRESULT WINAPI SVGSVGElement_putref_x(ISVGSVGElement *iface, ISVGAnimatedLength *v)
290 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
291 FIXME("(%p)->(%p)\n", This, v);
292 return E_NOTIMPL;
295 static HRESULT WINAPI SVGSVGElement_get_x(ISVGSVGElement *iface, ISVGAnimatedLength **p)
297 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
298 FIXME("(%p)->(%p)\n", This, p);
299 return E_NOTIMPL;
302 static HRESULT WINAPI SVGSVGElement_putref_y(ISVGSVGElement *iface, ISVGAnimatedLength *v)
304 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
305 FIXME("(%p)->(%p)\n", This, v);
306 return E_NOTIMPL;
309 static HRESULT WINAPI SVGSVGElement_get_y(ISVGSVGElement *iface, ISVGAnimatedLength **p)
311 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
312 FIXME("(%p)->(%p)\n", This, p);
313 return E_NOTIMPL;
316 static HRESULT WINAPI SVGSVGElement_putref_width(ISVGSVGElement *iface, ISVGAnimatedLength *v)
318 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
319 FIXME("(%p)->(%p)\n", This, v);
320 return E_NOTIMPL;
323 static HRESULT WINAPI SVGSVGElement_get_width(ISVGSVGElement *iface, ISVGAnimatedLength **p)
325 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
326 FIXME("(%p)->(%p)\n", This, p);
327 return E_NOTIMPL;
330 static HRESULT WINAPI SVGSVGElement_putref_height(ISVGSVGElement *iface, ISVGAnimatedLength *v)
332 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
333 FIXME("(%p)->(%p)\n", This, v);
334 return E_NOTIMPL;
337 static HRESULT WINAPI SVGSVGElement_get_height(ISVGSVGElement *iface, ISVGAnimatedLength **p)
339 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
340 FIXME("(%p)->(%p)\n", This, p);
341 return E_NOTIMPL;
344 static HRESULT WINAPI SVGSVGElement_put_contentScriptType(ISVGSVGElement *iface, BSTR v)
346 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
347 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
348 return E_NOTIMPL;
351 static HRESULT WINAPI SVGSVGElement_get_contentScriptType(ISVGSVGElement *iface, BSTR *p)
353 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
354 FIXME("(%p)->(%p)\n", This, p);
355 return E_NOTIMPL;
358 static HRESULT WINAPI SVGSVGElement_put_contentStyleType(ISVGSVGElement *iface, BSTR v)
360 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
361 FIXME("(%p)->(%p)\n", This, v);
362 return E_NOTIMPL;
365 static HRESULT WINAPI SVGSVGElement_get_contentStyleType(ISVGSVGElement *iface, BSTR *p)
367 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
368 FIXME("(%p)->(%p)\n", This, p);
369 return E_NOTIMPL;
372 static HRESULT WINAPI SVGSVGElement_putref_viewport(ISVGSVGElement *iface, ISVGRect *v)
374 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
375 FIXME("(%p)->(%p)\n", This, v);
376 return E_NOTIMPL;
379 static HRESULT WINAPI SVGSVGElement_get_viewport(ISVGSVGElement *iface, ISVGRect **p)
381 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
382 FIXME("(%p)->(%p)\n", This, p);
383 return E_NOTIMPL;
386 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterX(ISVGSVGElement *iface, float v)
388 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
389 FIXME("(%p)->(%f)\n", This, v);
390 return E_NOTIMPL;
393 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterX(ISVGSVGElement *iface, float *p)
395 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
396 FIXME("(%p)->(%p)\n", This, p);
397 return E_NOTIMPL;
400 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterY(ISVGSVGElement *iface, float v)
402 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
403 FIXME("(%p)->(%f)\n", This, v);
404 return E_NOTIMPL;
407 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterY(ISVGSVGElement *iface, float *p)
409 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
410 FIXME("(%p)->(%p)\n", This, p);
411 return E_NOTIMPL;
414 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterX(ISVGSVGElement *iface, float v)
416 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
417 FIXME("(%p)->(%f)\n", This, v);
418 return E_NOTIMPL;
421 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterX(ISVGSVGElement *iface, float *p)
423 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
424 FIXME("(%p)->(%p)\n", This, p);
425 return E_NOTIMPL;
428 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterY(ISVGSVGElement *iface, float v)
430 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
431 FIXME("(%p)->(%f)\n", This, v);
432 return E_NOTIMPL;
435 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterY(ISVGSVGElement *iface, float *p)
437 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
438 FIXME("(%p)->(%p)\n", This, p);
439 return E_NOTIMPL;
442 static HRESULT WINAPI SVGSVGElement_put_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL v)
444 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
445 FIXME("(%p)->(%x)\n", This, v);
446 return E_NOTIMPL;
449 static HRESULT WINAPI SVGSVGElement_get_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL *p)
451 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
452 FIXME("(%p)->(%p)\n", This, p);
453 return E_NOTIMPL;
456 static HRESULT WINAPI SVGSVGElement_putref_currentView(ISVGSVGElement *iface, ISVGViewSpec *v)
458 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
459 FIXME("(%p)->(%p)\n", This, v);
460 return E_NOTIMPL;
463 static HRESULT WINAPI SVGSVGElement_get_currentView(ISVGSVGElement *iface, ISVGViewSpec **p)
465 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
466 FIXME("(%p)->(%p)\n", This, p);
467 return E_NOTIMPL;
470 static HRESULT WINAPI SVGSVGElement_put_currentScale(ISVGSVGElement *iface, float v)
472 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
473 FIXME("(%p)->(%f)\n", This, v);
474 return E_NOTIMPL;
477 static HRESULT WINAPI SVGSVGElement_get_currentScale(ISVGSVGElement *iface, float *p)
479 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
480 FIXME("(%p)->(%p)\n", This, p);
481 return E_NOTIMPL;
484 static HRESULT WINAPI SVGSVGElement_putref_currentTranslate(ISVGSVGElement *iface, ISVGPoint *v)
486 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
487 FIXME("(%p)->(%p)\n", This, v);
488 return E_NOTIMPL;
491 static HRESULT WINAPI SVGSVGElement_get_currentTranslate(ISVGSVGElement *iface, ISVGPoint **p)
493 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
494 FIXME("(%p)->(%p)\n", This, p);
495 return E_NOTIMPL;
498 static HRESULT WINAPI SVGSVGElement_suspendRedraw(ISVGSVGElement *iface, ULONG max_wait, ULONG *p)
500 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
501 FIXME("(%p)->(%lu %p)\n", This, max_wait, p);
502 return E_NOTIMPL;
505 static HRESULT WINAPI SVGSVGElement_unsuspendRedraw(ISVGSVGElement *iface, ULONG id)
507 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
508 FIXME("(%p)->(%lu)\n", This, id);
509 return E_NOTIMPL;
512 static HRESULT WINAPI SVGSVGElement_unsuspendRedrawAll(ISVGSVGElement *iface)
514 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
515 FIXME("(%p)\n", This);
516 return E_NOTIMPL;
519 static HRESULT WINAPI SVGSVGElement_forceRedraw(ISVGSVGElement *iface)
521 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
522 FIXME("(%p)\n", This);
523 return E_NOTIMPL;
526 static HRESULT WINAPI SVGSVGElement_pauseAnimations(ISVGSVGElement *iface)
528 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
529 FIXME("(%p)\n", This);
530 return E_NOTIMPL;
533 static HRESULT WINAPI SVGSVGElement_unpauseAnimations(ISVGSVGElement *iface)
535 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
536 FIXME("(%p)\n", This);
537 return E_NOTIMPL;
540 static HRESULT WINAPI SVGSVGElement_animationsPaused(ISVGSVGElement *iface, VARIANT_BOOL *p)
542 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
543 FIXME("(%p)->(%p)\n", This, p);
544 return E_NOTIMPL;
547 static HRESULT WINAPI SVGSVGElement_getCurrentTime(ISVGSVGElement *iface, float *p)
549 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
550 FIXME("(%p)->(%p)\n", This, p);
551 return E_NOTIMPL;
554 static HRESULT WINAPI SVGSVGElement_setCurrentTime(ISVGSVGElement *iface, float v)
556 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
557 FIXME("(%p)->(%f)\n", This, v);
558 return E_NOTIMPL;
561 static HRESULT WINAPI SVGSVGElement_getIntersectionList(ISVGSVGElement *iface, ISVGRect *rect,
562 ISVGElement *reference_element, VARIANT *p)
564 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
565 FIXME("(%p)->(%p %p %p)\n", This, rect, reference_element, p);
566 return E_NOTIMPL;
569 static HRESULT WINAPI SVGSVGElement_getEnclosureList(ISVGSVGElement *iface, ISVGRect *rect,
570 ISVGElement *reference_element, VARIANT *p)
572 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
573 FIXME("(%p)->()\n", This);
574 return E_NOTIMPL;
577 static HRESULT WINAPI SVGSVGElement_checkIntersection(ISVGSVGElement *iface, ISVGElement *element,
578 ISVGRect *rect, VARIANT_BOOL *p)
580 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
581 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
582 return E_NOTIMPL;
585 static HRESULT WINAPI SVGSVGElement_checkEnclosure(ISVGSVGElement *iface, ISVGElement *element,
586 ISVGRect *rect, VARIANT_BOOL *p)
588 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
589 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
590 return E_NOTIMPL;
593 static HRESULT WINAPI SVGSVGElement_deselectAll(ISVGSVGElement *iface)
595 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
596 FIXME("(%p)\n", This);
597 return E_NOTIMPL;
600 static HRESULT WINAPI SVGSVGElement_createSVGNumber(ISVGSVGElement *iface, ISVGNumber **p)
602 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
603 FIXME("(%p)->(%p)\n", This, p);
604 return E_NOTIMPL;
607 static HRESULT WINAPI SVGSVGElement_createSVGLength(ISVGSVGElement *iface, ISVGLength **p)
609 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
610 FIXME("(%p)->(%p)\n", This, p);
611 return E_NOTIMPL;
614 static HRESULT WINAPI SVGSVGElement_createSVGAngle(ISVGSVGElement *iface, ISVGAngle **p)
616 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
617 FIXME("(%p)->(%p)\n", This, p);
618 return E_NOTIMPL;
621 static HRESULT WINAPI SVGSVGElement_createSVGPoint(ISVGSVGElement *iface, ISVGPoint **p)
623 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
624 FIXME("(%p)->(%p)\n", This, p);
625 return E_NOTIMPL;
628 static HRESULT WINAPI SVGSVGElement_createSVGMatrix(ISVGSVGElement *iface, ISVGMatrix **p)
630 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
631 FIXME("(%p)->(%p)\n", This, p);
632 return E_NOTIMPL;
635 static HRESULT WINAPI SVGSVGElement_createSVGRect(ISVGSVGElement *iface, ISVGRect **p)
637 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
638 FIXME("(%p)->(%p)\n", This, p);
639 return E_NOTIMPL;
642 static HRESULT WINAPI SVGSVGElement_createSVGTransform(ISVGSVGElement *iface, ISVGTransform **p)
644 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
645 FIXME("(%p)->(%p)\n", This, p);
646 return E_NOTIMPL;
649 static HRESULT WINAPI SVGSVGElement_createSVGTransformFromMatrix(ISVGSVGElement *iface,
650 ISVGMatrix *matrix, ISVGTransform **p)
652 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
653 FIXME("(%p)->(%p %p)\n", This, matrix, p);
654 return E_NOTIMPL;
657 static HRESULT WINAPI SVGSVGElement_getElementById(ISVGSVGElement *iface, BSTR id, IHTMLElement **p)
659 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
660 FIXME("(%p)->(%s %p)\n", This, debugstr_w(id), p);
661 return E_NOTIMPL;
664 static const ISVGSVGElementVtbl SVGSVGElementVtbl = {
665 SVGSVGElement_QueryInterface,
666 SVGSVGElement_AddRef,
667 SVGSVGElement_Release,
668 SVGSVGElement_GetTypeInfoCount,
669 SVGSVGElement_GetTypeInfo,
670 SVGSVGElement_GetIDsOfNames,
671 SVGSVGElement_Invoke,
672 SVGSVGElement_putref_x,
673 SVGSVGElement_get_x,
674 SVGSVGElement_putref_y,
675 SVGSVGElement_get_y,
676 SVGSVGElement_putref_width,
677 SVGSVGElement_get_width,
678 SVGSVGElement_putref_height,
679 SVGSVGElement_get_height,
680 SVGSVGElement_put_contentScriptType,
681 SVGSVGElement_get_contentScriptType,
682 SVGSVGElement_put_contentStyleType,
683 SVGSVGElement_get_contentStyleType,
684 SVGSVGElement_putref_viewport,
685 SVGSVGElement_get_viewport,
686 SVGSVGElement_put_pixelUnitToMillimeterX,
687 SVGSVGElement_get_pixelUnitToMillimeterX,
688 SVGSVGElement_put_pixelUnitToMillimeterY,
689 SVGSVGElement_get_pixelUnitToMillimeterY,
690 SVGSVGElement_put_screenPixelToMillimeterX,
691 SVGSVGElement_get_screenPixelToMillimeterX,
692 SVGSVGElement_put_screenPixelToMillimeterY,
693 SVGSVGElement_get_screenPixelToMillimeterY,
694 SVGSVGElement_put_useCurrentView,
695 SVGSVGElement_get_useCurrentView,
696 SVGSVGElement_putref_currentView,
697 SVGSVGElement_get_currentView,
698 SVGSVGElement_put_currentScale,
699 SVGSVGElement_get_currentScale,
700 SVGSVGElement_putref_currentTranslate,
701 SVGSVGElement_get_currentTranslate,
702 SVGSVGElement_suspendRedraw,
703 SVGSVGElement_unsuspendRedraw,
704 SVGSVGElement_unsuspendRedrawAll,
705 SVGSVGElement_forceRedraw,
706 SVGSVGElement_pauseAnimations,
707 SVGSVGElement_unpauseAnimations,
708 SVGSVGElement_animationsPaused,
709 SVGSVGElement_getCurrentTime,
710 SVGSVGElement_setCurrentTime,
711 SVGSVGElement_getIntersectionList,
712 SVGSVGElement_getEnclosureList,
713 SVGSVGElement_checkIntersection,
714 SVGSVGElement_checkEnclosure,
715 SVGSVGElement_deselectAll,
716 SVGSVGElement_createSVGNumber,
717 SVGSVGElement_createSVGLength,
718 SVGSVGElement_createSVGAngle,
719 SVGSVGElement_createSVGPoint,
720 SVGSVGElement_createSVGMatrix,
721 SVGSVGElement_createSVGRect,
722 SVGSVGElement_createSVGTransform,
723 SVGSVGElement_createSVGTransformFromMatrix,
724 SVGSVGElement_getElementById
727 static inline SVGSVGElement *SVGSVGElement_from_DispatchEx(DispatchEx *iface)
729 return CONTAINING_RECORD(iface, SVGSVGElement, svg_element.element.node.event_target.dispex);
732 static void *SVGSVGElement_query_interface(DispatchEx *dispex, REFIID riid)
734 SVGSVGElement *This = SVGSVGElement_from_DispatchEx(dispex);
736 if(IsEqualGUID(&IID_ISVGSVGElement, riid))
737 return &This->ISVGSVGElement_iface;
739 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
742 static const NodeImplVtbl SVGSVGElementImplVtbl = {
743 .clsid = &CLSID_SVGSVGElement,
744 .cpc_entries = HTMLElement_cpc,
745 .clone = HTMLElement_clone,
746 .get_attr_col = HTMLElement_get_attr_col,
749 static const event_target_vtbl_t SVGSVGElement_event_target_vtbl = {
751 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
752 .query_interface= SVGSVGElement_query_interface,
753 .destructor = HTMLElement_destructor,
754 .traverse = HTMLDOMNode_traverse,
755 .unlink = HTMLDOMNode_unlink
757 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
758 .handle_event = HTMLElement_handle_event
761 static dispex_static_data_t SVGSVGElement_dispex = {
762 "HTMLUnknownElement",
763 &SVGSVGElement_event_target_vtbl.dispex_vtbl,
764 DispHTMLUnknownElement_tid,
765 HTMLElement_iface_tids,
766 HTMLElement_init_dispex_info
769 static HRESULT create_viewport_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
771 SVGSVGElement *ret;
773 ret = calloc(1, sizeof(SVGSVGElement));
774 if(!ret)
775 return E_OUTOFMEMORY;
777 ret->ISVGSVGElement_iface.lpVtbl = &SVGSVGElementVtbl;
778 ret->svg_element.element.node.vtbl = &SVGSVGElementImplVtbl;
780 init_svg_element(&ret->svg_element, doc, nselem, &SVGSVGElement_dispex);
782 *elem = &ret->svg_element.element;
783 return S_OK;
786 struct SVGCircleElement {
787 SVGElement svg_element;
788 ISVGCircleElement ISVGCircleElement_iface;
791 static inline SVGCircleElement *impl_from_ISVGCircleElement(ISVGCircleElement *iface)
793 return CONTAINING_RECORD(iface, SVGCircleElement, ISVGCircleElement_iface);
796 static HRESULT WINAPI SVGCircleElement_QueryInterface(ISVGCircleElement *iface,
797 REFIID riid, void **ppv)
799 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
801 return IHTMLDOMNode_QueryInterface(&This->svg_element.element.node.IHTMLDOMNode_iface, riid, ppv);
804 static ULONG WINAPI SVGCircleElement_AddRef(ISVGCircleElement *iface)
806 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
808 return IHTMLDOMNode_AddRef(&This->svg_element.element.node.IHTMLDOMNode_iface);
811 static ULONG WINAPI SVGCircleElement_Release(ISVGCircleElement *iface)
813 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
815 return IHTMLDOMNode_Release(&This->svg_element.element.node.IHTMLDOMNode_iface);
818 static HRESULT WINAPI SVGCircleElement_GetTypeInfoCount(ISVGCircleElement *iface, UINT *pctinfo)
820 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
821 return IDispatchEx_GetTypeInfoCount(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
824 static HRESULT WINAPI SVGCircleElement_GetTypeInfo(ISVGCircleElement *iface, UINT iTInfo,
825 LCID lcid, ITypeInfo **ppTInfo)
827 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
828 return IDispatchEx_GetTypeInfo(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
829 ppTInfo);
832 static HRESULT WINAPI SVGCircleElement_GetIDsOfNames(ISVGCircleElement *iface, REFIID riid,
833 LPOLESTR *rgszNames, UINT cNames,
834 LCID lcid, DISPID *rgDispId)
836 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
837 return IDispatchEx_GetIDsOfNames(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
838 cNames, lcid, rgDispId);
841 static HRESULT WINAPI SVGCircleElement_Invoke(ISVGCircleElement *iface, DISPID dispIdMember,
842 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
843 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
845 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
846 return IDispatchEx_Invoke(&This->svg_element.element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
847 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
850 static HRESULT WINAPI SVGCircleElement_putref_cx(ISVGCircleElement *iface, ISVGAnimatedLength *v)
852 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
853 FIXME("(%p)->(%p)\n", This, v);
854 return E_NOTIMPL;
857 static HRESULT WINAPI SVGCircleElement_get_cx(ISVGCircleElement *iface, ISVGAnimatedLength **p)
859 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
860 FIXME("(%p)->(%p)\n", This, p);
861 return E_NOTIMPL;
864 static HRESULT WINAPI SVGCircleElement_putref_cy(ISVGCircleElement *iface, ISVGAnimatedLength *v)
866 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
867 FIXME("(%p)->(%p)\n", This, v);
868 return E_NOTIMPL;
871 static HRESULT WINAPI SVGCircleElement_get_cy(ISVGCircleElement *iface, ISVGAnimatedLength **p)
873 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
874 FIXME("(%p)->(%p)\n", This, p);
875 return E_NOTIMPL;
878 static HRESULT WINAPI SVGCircleElement_putref_r(ISVGCircleElement *iface, ISVGAnimatedLength *v)
880 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
881 FIXME("(%p)->(%p)\n", This, v);
882 return E_NOTIMPL;
885 static HRESULT WINAPI SVGCircleElement_get_r(ISVGCircleElement *iface, ISVGAnimatedLength **p)
887 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
888 FIXME("(%p)->(%p)\n", This, p);
889 return E_NOTIMPL;
892 static const ISVGCircleElementVtbl SVGCircleElementVtbl = {
893 SVGCircleElement_QueryInterface,
894 SVGCircleElement_AddRef,
895 SVGCircleElement_Release,
896 SVGCircleElement_GetTypeInfoCount,
897 SVGCircleElement_GetTypeInfo,
898 SVGCircleElement_GetIDsOfNames,
899 SVGCircleElement_Invoke,
900 SVGCircleElement_putref_cx,
901 SVGCircleElement_get_cx,
902 SVGCircleElement_putref_cy,
903 SVGCircleElement_get_cy,
904 SVGCircleElement_putref_r,
905 SVGCircleElement_get_r
908 static inline SVGCircleElement *SVGCircleElement_from_DispatchEx(DispatchEx *iface)
910 return CONTAINING_RECORD(iface, SVGCircleElement, svg_element.element.node.event_target.dispex);
913 static void *SVGCircleElement_query_interface(DispatchEx *dispex, REFIID riid)
915 SVGCircleElement *This = SVGCircleElement_from_DispatchEx(dispex);
917 if(IsEqualGUID(&IID_ISVGCircleElement, riid))
918 return &This->ISVGCircleElement_iface;
920 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
923 static const NodeImplVtbl SVGCircleElementImplVtbl = {
924 .clsid = &CLSID_SVGCircleElement,
925 .cpc_entries = HTMLElement_cpc,
926 .clone = HTMLElement_clone,
927 .get_attr_col = HTMLElement_get_attr_col,
930 static const event_target_vtbl_t SVGCircleElement_event_target_vtbl = {
932 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
933 .query_interface= SVGCircleElement_query_interface,
934 .destructor = HTMLElement_destructor,
935 .traverse = HTMLDOMNode_traverse,
936 .unlink = HTMLDOMNode_unlink
938 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
939 .handle_event = HTMLElement_handle_event
942 static dispex_static_data_t SVGCircleElement_dispex = {
943 "HTMLUnknownElement",
944 &SVGCircleElement_event_target_vtbl.dispex_vtbl,
945 DispHTMLUnknownElement_tid,
946 HTMLElement_iface_tids,
947 HTMLElement_init_dispex_info
950 static HRESULT create_circle_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
952 SVGCircleElement *ret;
954 ret = calloc(1, sizeof(SVGCircleElement));
955 if(!ret)
956 return E_OUTOFMEMORY;
958 ret->ISVGCircleElement_iface.lpVtbl = &SVGCircleElementVtbl;
959 ret->svg_element.element.node.vtbl = &SVGCircleElementImplVtbl;
961 init_svg_element(&ret->svg_element, doc, nselem, &SVGCircleElement_dispex);
963 *elem = &ret->svg_element.element;
964 return S_OK;
967 typedef struct {
968 ISVGTextContentElement ISVGTextContentElement_iface;
969 SVGElement *svg_element;
970 } SVGTextContentElement;
972 static inline SVGTextContentElement *impl_from_ISVGTextContentElement(ISVGTextContentElement *iface)
974 return CONTAINING_RECORD(iface, SVGTextContentElement, ISVGTextContentElement_iface);
977 static HRESULT WINAPI SVGTextContentElement_QueryInterface(ISVGTextContentElement *iface,
978 REFIID riid, void **ppv)
980 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
981 return IHTMLDOMNode_QueryInterface(&This->svg_element->element.node.IHTMLDOMNode_iface, riid, ppv);
984 static ULONG WINAPI SVGTextContentElement_AddRef(ISVGTextContentElement *iface)
986 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
988 return IHTMLDOMNode_AddRef(&This->svg_element->element.node.IHTMLDOMNode_iface);
991 static ULONG WINAPI SVGTextContentElement_Release(ISVGTextContentElement *iface)
993 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
995 return IHTMLDOMNode_Release(&This->svg_element->element.node.IHTMLDOMNode_iface);
998 static HRESULT WINAPI SVGTextContentElement_GetTypeInfoCount(ISVGTextContentElement *iface, UINT *pctinfo)
1000 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1001 return IDispatchEx_GetTypeInfoCount(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1004 static HRESULT WINAPI SVGTextContentElement_GetTypeInfo(ISVGTextContentElement *iface, UINT iTInfo,
1005 LCID lcid, ITypeInfo **ppTInfo)
1007 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1008 return IDispatchEx_GetTypeInfo(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
1009 ppTInfo);
1012 static HRESULT WINAPI SVGTextContentElement_GetIDsOfNames(ISVGTextContentElement *iface, REFIID riid,
1013 LPOLESTR *rgszNames, UINT cNames,
1014 LCID lcid, DISPID *rgDispId)
1016 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1017 return IDispatchEx_GetIDsOfNames(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1018 cNames, lcid, rgDispId);
1021 static HRESULT WINAPI SVGTextContentElement_Invoke(ISVGTextContentElement *iface, DISPID dispIdMember,
1022 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1023 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1025 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1026 return IDispatchEx_Invoke(&This->svg_element->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1027 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1030 static HRESULT WINAPI SVGTextContentElement_putref_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength *v)
1032 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1033 FIXME("(%p)->(%p)\n", This, v);
1034 return E_NOTIMPL;
1037 static HRESULT WINAPI SVGTextContentElement_get_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength **p)
1039 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1040 FIXME("(%p)->(%p)\n", This, p);
1041 return E_NOTIMPL;
1044 static HRESULT WINAPI SVGTextContentElement_putref_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration *v)
1046 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1047 FIXME("(%p)->(%p)\n", This, v);
1048 return E_NOTIMPL;
1051 static HRESULT WINAPI SVGTextContentElement_get_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration **p)
1053 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1054 FIXME("(%p)->(%p)\n", This, p);
1055 return E_NOTIMPL;
1058 static HRESULT WINAPI SVGTextContentElement_getNumberOfChars(ISVGTextContentElement *iface, LONG *p)
1060 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1061 FIXME("(%p)->(%p)\n", This, p);
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI SVGTextContentElement_getComputedTextLength(ISVGTextContentElement *iface, float *p)
1067 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1068 FIXME("(%p)->(%p)\n", This, p);
1069 return E_NOTIMPL;
1072 static HRESULT WINAPI SVGTextContentElement_getSubStringLength(ISVGTextContentElement *iface,
1073 LONG charnum, LONG nchars, float *p)
1075 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1076 FIXME("(%p)->(%ld %ld %p)\n", This, charnum, nchars, p);
1077 return E_NOTIMPL;
1080 static HRESULT WINAPI SVGTextContentElement_getStartPositionOfChar(ISVGTextContentElement *iface,
1081 LONG charnum, ISVGPoint **p)
1083 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1084 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1085 return E_NOTIMPL;
1088 static HRESULT WINAPI SVGTextContentElement_getEndPositionOfChar(ISVGTextContentElement *iface,
1089 LONG charnum, ISVGPoint **p)
1091 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1092 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1093 return E_NOTIMPL;
1096 static HRESULT WINAPI SVGTextContentElement_getExtentOfChar(ISVGTextContentElement *iface,
1097 LONG charnum, ISVGRect **p)
1099 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1100 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1101 return E_NOTIMPL;
1104 static HRESULT WINAPI SVGTextContentElement_getRotationOfChar(ISVGTextContentElement *iface,
1105 LONG charnum, float *p)
1107 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1108 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
1109 return E_NOTIMPL;
1112 static HRESULT WINAPI SVGTextContentElement_getCharNumAtPosition(ISVGTextContentElement *iface,
1113 ISVGPoint *point, LONG *p)
1115 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1116 FIXME("(%p)->(%p %p)\n", This, point, p);
1117 return E_NOTIMPL;
1120 static HRESULT WINAPI SVGTextContentElement_selectSubString(ISVGTextContentElement *iface,
1121 LONG charnum, LONG nchars)
1123 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
1124 FIXME("(%p)->(%ld %ld)\n", This, charnum, nchars);
1125 return E_NOTIMPL;
1128 static const ISVGTextContentElementVtbl SVGTextContentElementVtbl = {
1129 SVGTextContentElement_QueryInterface,
1130 SVGTextContentElement_AddRef,
1131 SVGTextContentElement_Release,
1132 SVGTextContentElement_GetTypeInfoCount,
1133 SVGTextContentElement_GetTypeInfo,
1134 SVGTextContentElement_GetIDsOfNames,
1135 SVGTextContentElement_Invoke,
1136 SVGTextContentElement_putref_textLength,
1137 SVGTextContentElement_get_textLength,
1138 SVGTextContentElement_putref_lengthAdjust,
1139 SVGTextContentElement_get_lengthAdjust,
1140 SVGTextContentElement_getNumberOfChars,
1141 SVGTextContentElement_getComputedTextLength,
1142 SVGTextContentElement_getSubStringLength,
1143 SVGTextContentElement_getStartPositionOfChar,
1144 SVGTextContentElement_getEndPositionOfChar,
1145 SVGTextContentElement_getExtentOfChar,
1146 SVGTextContentElement_getRotationOfChar,
1147 SVGTextContentElement_getCharNumAtPosition,
1148 SVGTextContentElement_selectSubString
1151 static void init_text_content_element(SVGTextContentElement *text_content, SVGElement *svg_element)
1153 text_content->ISVGTextContentElement_iface.lpVtbl = &SVGTextContentElementVtbl;
1154 text_content->svg_element = svg_element;
1157 struct SVGTSpanElement {
1158 SVGElement svg_element;
1159 SVGTextContentElement text_content;
1162 static inline SVGTSpanElement *SVGTSpanElement_from_DispatchEx(DispatchEx *iface)
1164 return CONTAINING_RECORD(iface, SVGTSpanElement, svg_element.element.node.event_target.dispex);
1167 static void *SVGTSpanElement_query_interface(DispatchEx *dispex, REFIID riid)
1169 SVGTSpanElement *This = SVGTSpanElement_from_DispatchEx(dispex);
1171 if(IsEqualGUID(&IID_ISVGTSpanElement, riid))
1172 return &This->svg_element.ISVGElement_iface; /* no additional methods */
1173 if(IsEqualGUID(&IID_ISVGTextContentElement, riid))
1174 return &This->text_content.ISVGTextContentElement_iface;
1176 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
1179 static const NodeImplVtbl SVGTSpanElementImplVtbl = {
1180 .clsid = &CLSID_SVGTSpanElement,
1181 .cpc_entries = HTMLElement_cpc,
1182 .clone = HTMLElement_clone,
1183 .get_attr_col = HTMLElement_get_attr_col,
1186 static const event_target_vtbl_t SVGTSpanElement_event_target_vtbl = {
1188 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
1189 .query_interface= SVGTSpanElement_query_interface,
1190 .destructor = HTMLElement_destructor,
1191 .traverse = HTMLDOMNode_traverse,
1192 .unlink = HTMLDOMNode_unlink
1194 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
1195 .handle_event = HTMLElement_handle_event
1198 static dispex_static_data_t SVGTSpanElement_dispex = {
1199 "HTMLUnknownElement",
1200 &SVGTSpanElement_event_target_vtbl.dispex_vtbl,
1201 DispHTMLUnknownElement_tid,
1202 HTMLElement_iface_tids,
1203 HTMLElement_init_dispex_info
1206 static HRESULT create_tspan_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
1208 SVGTSpanElement *ret;
1210 ret = calloc(1, sizeof(SVGTSpanElement));
1211 if(!ret)
1212 return E_OUTOFMEMORY;
1214 ret->svg_element.element.node.vtbl = &SVGTSpanElementImplVtbl;
1215 init_text_content_element(&ret->text_content, &ret->svg_element);
1216 init_svg_element(&ret->svg_element, doc, nselem, &SVGTSpanElement_dispex);
1218 *elem = &ret->svg_element.element;
1219 return S_OK;
1222 HRESULT create_svg_element(HTMLDocumentNode *doc, nsIDOMSVGElement *dom_element, const WCHAR *tag_name, HTMLElement **elem)
1224 SVGElement *svg_element;
1226 TRACE("%s\n", debugstr_w(tag_name));
1228 if(!wcscmp(tag_name, L"svg"))
1229 return create_viewport_element(doc, dom_element, elem);
1230 if(!wcscmp(tag_name, L"circle"))
1231 return create_circle_element(doc, dom_element, elem);
1232 if(!wcscmp(tag_name, L"tspan"))
1233 return create_tspan_element(doc, dom_element, elem);
1235 svg_element = calloc(1, sizeof(*svg_element));
1236 if(!svg_element)
1237 return E_OUTOFMEMORY;
1239 svg_element->element.node.vtbl = &SVGElementImplVtbl;
1240 init_svg_element(svg_element, doc, dom_element, &SVGElement_dispex);
1241 *elem = &svg_element->element;
1242 return S_OK;