mshtml/tests: Added IHTMLAttributeCollection tests.
[wine] / dlls / mshtml / htmltable.c
1 /*
2  * Copyright 2007 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "wine/debug.h"
29
30 #include "mshtml_private.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
33
34 struct HTMLTable {
35     HTMLElement element;
36
37     IHTMLTable IHTMLTable_iface;
38
39     ConnectionPoint cp;
40     nsIDOMHTMLTableElement *nstable;
41 };
42
43 static inline HTMLTable *impl_from_IHTMLTable(IHTMLTable *iface)
44 {
45     return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable_iface);
46 }
47
48 static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface,
49                                                          REFIID riid, void **ppv)
50 {
51     HTMLTable *This = impl_from_IHTMLTable(iface);
52
53     return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
54 }
55
56 static ULONG WINAPI HTMLTable_AddRef(IHTMLTable *iface)
57 {
58     HTMLTable *This = impl_from_IHTMLTable(iface);
59
60     return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
61 }
62
63 static ULONG WINAPI HTMLTable_Release(IHTMLTable *iface)
64 {
65     HTMLTable *This = impl_from_IHTMLTable(iface);
66
67     return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
68 }
69
70 static HRESULT WINAPI HTMLTable_GetTypeInfoCount(IHTMLTable *iface, UINT *pctinfo)
71 {
72     HTMLTable *This = impl_from_IHTMLTable(iface);
73     return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
74 }
75
76 static HRESULT WINAPI HTMLTable_GetTypeInfo(IHTMLTable *iface, UINT iTInfo,
77                                               LCID lcid, ITypeInfo **ppTInfo)
78 {
79     HTMLTable *This = impl_from_IHTMLTable(iface);
80     return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
81             ppTInfo);
82 }
83
84 static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
85                                                 LPOLESTR *rgszNames, UINT cNames,
86                                                 LCID lcid, DISPID *rgDispId)
87 {
88     HTMLTable *This = impl_from_IHTMLTable(iface);
89     return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
90             cNames, lcid, rgDispId);
91 }
92
93 static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
94                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
95                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
96 {
97     HTMLTable *This = impl_from_IHTMLTable(iface);
98     return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
99             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
100 }
101
102 static HRESULT WINAPI HTMLTable_put_cols(IHTMLTable *iface, LONG v)
103 {
104     HTMLTable *This = impl_from_IHTMLTable(iface);
105     FIXME("(%p)->(%d)\n", This, v);
106     return E_NOTIMPL;
107 }
108
109 static HRESULT WINAPI HTMLTable_get_cols(IHTMLTable *iface, LONG *p)
110 {
111     HTMLTable *This = impl_from_IHTMLTable(iface);
112     FIXME("(%p)->(%p)\n", This, p);
113     return E_NOTIMPL;
114 }
115
116 static HRESULT WINAPI HTMLTable_put_border(IHTMLTable *iface, VARIANT v)
117 {
118     HTMLTable *This = impl_from_IHTMLTable(iface);
119     FIXME("(%p)->(v)\n", This);
120     return E_NOTIMPL;
121 }
122
123 static HRESULT WINAPI HTMLTable_get_border(IHTMLTable *iface, VARIANT *p)
124 {
125     HTMLTable *This = impl_from_IHTMLTable(iface);
126     FIXME("(%p)->(%p)\n", This, p);
127     return E_NOTIMPL;
128 }
129
130 static HRESULT WINAPI HTMLTable_put_frame(IHTMLTable *iface, BSTR v)
131 {
132     HTMLTable *This = impl_from_IHTMLTable(iface);
133     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
134     return E_NOTIMPL;
135 }
136
137 static HRESULT WINAPI HTMLTable_get_frame(IHTMLTable *iface, BSTR *p)
138 {
139     HTMLTable *This = impl_from_IHTMLTable(iface);
140     FIXME("(%p)->(%p)\n", This, p);
141     return E_NOTIMPL;
142 }
143
144 static HRESULT WINAPI HTMLTable_put_rules(IHTMLTable *iface, BSTR v)
145 {
146     HTMLTable *This = impl_from_IHTMLTable(iface);
147     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
148     return E_NOTIMPL;
149 }
150
151 static HRESULT WINAPI HTMLTable_get_rules(IHTMLTable *iface, BSTR *p)
152 {
153     HTMLTable *This = impl_from_IHTMLTable(iface);
154     FIXME("(%p)->(%p)\n", This, p);
155     return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v)
159 {
160     HTMLTable *This = impl_from_IHTMLTable(iface);
161     FIXME("(%p)->(v)\n", This);
162     return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI HTMLTable_get_cellSpacing(IHTMLTable *iface, VARIANT *p)
166 {
167     HTMLTable *This = impl_from_IHTMLTable(iface);
168     FIXME("(%p)->(%p)\n", This, p);
169     return E_NOTIMPL;
170 }
171
172 static HRESULT WINAPI HTMLTable_put_cellPadding(IHTMLTable *iface, VARIANT v)
173 {
174     HTMLTable *This = impl_from_IHTMLTable(iface);
175     FIXME("(%p)->(v)\n", This);
176     return E_NOTIMPL;
177 }
178
179 static HRESULT WINAPI HTMLTable_get_cellPadding(IHTMLTable *iface, VARIANT *p)
180 {
181     HTMLTable *This = impl_from_IHTMLTable(iface);
182     FIXME("(%p)->(%p)\n", This, p);
183     return E_NOTIMPL;
184 }
185
186 static HRESULT WINAPI HTMLTable_put_background(IHTMLTable *iface, BSTR v)
187 {
188     HTMLTable *This = impl_from_IHTMLTable(iface);
189     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
190     return E_NOTIMPL;
191 }
192
193 static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
194 {
195     HTMLTable *This = impl_from_IHTMLTable(iface);
196     FIXME("(%p)->(%p)\n", This, p);
197     return E_NOTIMPL;
198 }
199
200 static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v)
201 {
202     HTMLTable *This = impl_from_IHTMLTable(iface);
203     FIXME("(%p)->(v)\n", This);
204     return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p)
208 {
209     HTMLTable *This = impl_from_IHTMLTable(iface);
210     FIXME("(%p)->(%p)\n", This, p);
211     return E_NOTIMPL;
212 }
213
214 static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v)
215 {
216     HTMLTable *This = impl_from_IHTMLTable(iface);
217     FIXME("(%p)->(v)\n", This);
218     return E_NOTIMPL;
219 }
220
221 static HRESULT WINAPI HTMLTable_get_borderColor(IHTMLTable *iface, VARIANT *p)
222 {
223     HTMLTable *This = impl_from_IHTMLTable(iface);
224     FIXME("(%p)->(%p)\n", This, p);
225     return E_NOTIMPL;
226 }
227
228 static HRESULT WINAPI HTMLTable_put_borderColorLight(IHTMLTable *iface, VARIANT v)
229 {
230     HTMLTable *This = impl_from_IHTMLTable(iface);
231     FIXME("(%p)->(v)\n", This);
232     return E_NOTIMPL;
233 }
234
235 static HRESULT WINAPI HTMLTable_get_borderColorLight(IHTMLTable *iface, VARIANT *p)
236 {
237     HTMLTable *This = impl_from_IHTMLTable(iface);
238     FIXME("(%p)->(%p)\n", This, p);
239     return E_NOTIMPL;
240 }
241
242 static HRESULT WINAPI HTMLTable_put_borderColorDark(IHTMLTable *iface, VARIANT v)
243 {
244     HTMLTable *This = impl_from_IHTMLTable(iface);
245     FIXME("(%p)->(v)\n", This);
246     return E_NOTIMPL;
247 }
248
249 static HRESULT WINAPI HTMLTable_get_borderColorDark(IHTMLTable *iface, VARIANT *p)
250 {
251     HTMLTable *This = impl_from_IHTMLTable(iface);
252     FIXME("(%p)->(%p)\n", This, p);
253     return E_NOTIMPL;
254 }
255
256 static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v)
257 {
258     HTMLTable *This = impl_from_IHTMLTable(iface);
259     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
260     return E_NOTIMPL;
261 }
262
263 static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p)
264 {
265     HTMLTable *This = impl_from_IHTMLTable(iface);
266     FIXME("(%p)->(%p)\n", This, p);
267     return E_NOTIMPL;
268 }
269
270 static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
271 {
272     HTMLTable *This = impl_from_IHTMLTable(iface);
273     FIXME("(%p)\n", This);
274     return E_NOTIMPL;
275 }
276
277 static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollection **p)
278 {
279     HTMLTable *This = impl_from_IHTMLTable(iface);
280     nsIDOMHTMLCollection *nscol;
281     nsresult nsres;
282
283     TRACE("(%p)->(%p)\n", This, p);
284
285     nsres = nsIDOMHTMLTableElement_GetRows(This->nstable, &nscol);
286     if(NS_FAILED(nsres)) {
287         ERR("GetRows failed: %08x\n", nsres);
288         return E_FAIL;
289     }
290
291     *p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)&This->IHTMLTable_iface,
292             nscol);
293
294     nsIDOMHTMLCollection_Release(nscol);
295     return S_OK;
296 }
297
298 static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v)
299 {
300     HTMLTable *This = impl_from_IHTMLTable(iface);
301     FIXME("(%p)->(v)\n", This);
302     return E_NOTIMPL;
303 }
304
305 static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
306 {
307     HTMLTable *This = impl_from_IHTMLTable(iface);
308     FIXME("(%p)->(%p)\n", This, p);
309     return E_NOTIMPL;
310 }
311
312 static HRESULT WINAPI HTMLTable_put_height(IHTMLTable *iface, VARIANT v)
313 {
314     HTMLTable *This = impl_from_IHTMLTable(iface);
315     FIXME("(%p)->(v)\n", This);
316     return E_NOTIMPL;
317 }
318
319 static HRESULT WINAPI HTMLTable_get_height(IHTMLTable *iface, VARIANT *p)
320 {
321     HTMLTable *This = impl_from_IHTMLTable(iface);
322     FIXME("(%p)->(%p)\n", This, p);
323     return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI HTMLTable_put_dataPageSize(IHTMLTable *iface, LONG v)
327 {
328     HTMLTable *This = impl_from_IHTMLTable(iface);
329     FIXME("(%p)->(%d)\n", This, v);
330     return E_NOTIMPL;
331 }
332
333 static HRESULT WINAPI HTMLTable_get_dataPageSize(IHTMLTable *iface, LONG *p)
334 {
335     HTMLTable *This = impl_from_IHTMLTable(iface);
336     FIXME("(%p)->(%p)\n", This, p);
337     return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI HTMLTable_nextPage(IHTMLTable *iface)
341 {
342     HTMLTable *This = impl_from_IHTMLTable(iface);
343     FIXME("(%p)\n", This);
344     return E_NOTIMPL;
345 }
346
347 static HRESULT WINAPI HTMLTable_previousPage(IHTMLTable *iface)
348 {
349     HTMLTable *This = impl_from_IHTMLTable(iface);
350     FIXME("(%p)\n", This);
351     return E_NOTIMPL;
352 }
353
354 static HRESULT WINAPI HTMLTable_get_tHead(IHTMLTable *iface, IHTMLTableSection **p)
355 {
356     HTMLTable *This = impl_from_IHTMLTable(iface);
357     FIXME("(%p)->(%p)\n", This, p);
358     return E_NOTIMPL;
359 }
360
361 static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection **p)
362 {
363     HTMLTable *This = impl_from_IHTMLTable(iface);
364     FIXME("(%p)->(%p)\n", This, p);
365     return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
369 {
370     HTMLTable *This = impl_from_IHTMLTable(iface);
371     FIXME("(%p)->(%p)\n", This, p);
372     return E_NOTIMPL;
373 }
374
375 static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
376 {
377     HTMLTable *This = impl_from_IHTMLTable(iface);
378     FIXME("(%p)->(%p)\n", This, p);
379     return E_NOTIMPL;
380 }
381
382 static HRESULT WINAPI HTMLTable_createTHead(IHTMLTable *iface, IDispatch **head)
383 {
384     HTMLTable *This = impl_from_IHTMLTable(iface);
385     FIXME("(%p)->(%p)\n", This, head);
386     return E_NOTIMPL;
387 }
388
389 static HRESULT WINAPI HTMLTable_deleteTHead(IHTMLTable *iface)
390 {
391     HTMLTable *This = impl_from_IHTMLTable(iface);
392     FIXME("(%p)\n", This);
393     return E_NOTIMPL;
394 }
395
396 static HRESULT WINAPI HTMLTable_createTFoot(IHTMLTable *iface, IDispatch **foot)
397 {
398     HTMLTable *This = impl_from_IHTMLTable(iface);
399     FIXME("(%p)->(%p)\n", This, foot);
400     return E_NOTIMPL;
401 }
402
403 static HRESULT WINAPI HTMLTable_deleteTFoot(IHTMLTable *iface)
404 {
405     HTMLTable *This = impl_from_IHTMLTable(iface);
406     FIXME("(%p)\n", This);
407     return E_NOTIMPL;
408 }
409
410 static HRESULT WINAPI HTMLTable_createCaption(IHTMLTable *iface, IHTMLTableCaption **caption)
411 {
412     HTMLTable *This = impl_from_IHTMLTable(iface);
413     FIXME("(%p)->(%p)\n", This, caption);
414     return E_NOTIMPL;
415 }
416
417 static HRESULT WINAPI HTMLTable_deleteCaption(IHTMLTable *iface)
418 {
419     HTMLTable *This = impl_from_IHTMLTable(iface);
420     FIXME("(%p)\n", This);
421     return E_NOTIMPL;
422 }
423
424 static HRESULT WINAPI HTMLTable_insertRow(IHTMLTable *iface, LONG index, IDispatch **row)
425 {
426     HTMLTable *This = impl_from_IHTMLTable(iface);
427     FIXME("(%p)->(%d %p)\n", This, index, row);
428     return E_NOTIMPL;
429 }
430
431 static HRESULT WINAPI HTMLTable_deleteRow(IHTMLTable *iface, LONG index)
432 {
433     HTMLTable *This = impl_from_IHTMLTable(iface);
434     FIXME("(%p)->(%d)\n", This, index);
435     return E_NOTIMPL;
436 }
437
438 static HRESULT WINAPI HTMLTable_get_readyState(IHTMLTable *iface, BSTR *p)
439 {
440     HTMLTable *This = impl_from_IHTMLTable(iface);
441     FIXME("(%p)->(%p)\n", This, p);
442     return E_NOTIMPL;
443 }
444
445 static HRESULT WINAPI HTMLTable_put_onreadystatechange(IHTMLTable *iface, VARIANT v)
446 {
447     HTMLTable *This = impl_from_IHTMLTable(iface);
448     FIXME("(%p)->(v)\n", This);
449     return E_NOTIMPL;
450 }
451
452 static HRESULT WINAPI HTMLTable_get_onreadystatechange(IHTMLTable *iface, VARIANT *p)
453 {
454     HTMLTable *This = impl_from_IHTMLTable(iface);
455     FIXME("(%p)->(%p)\n", This, p);
456     return E_NOTIMPL;
457 }
458
459 static const IHTMLTableVtbl HTMLTableVtbl = {
460     HTMLTable_QueryInterface,
461     HTMLTable_AddRef,
462     HTMLTable_Release,
463     HTMLTable_GetTypeInfoCount,
464     HTMLTable_GetTypeInfo,
465     HTMLTable_GetIDsOfNames,
466     HTMLTable_Invoke,
467     HTMLTable_put_cols,
468     HTMLTable_get_cols,
469     HTMLTable_put_border,
470     HTMLTable_get_border,
471     HTMLTable_put_frame,
472     HTMLTable_get_frame,
473     HTMLTable_put_rules,
474     HTMLTable_get_rules,
475     HTMLTable_put_cellSpacing,
476     HTMLTable_get_cellSpacing,
477     HTMLTable_put_cellPadding,
478     HTMLTable_get_cellPadding,
479     HTMLTable_put_background,
480     HTMLTable_get_background,
481     HTMLTable_put_bgColor,
482     HTMLTable_get_bgColor,
483     HTMLTable_put_borderColor,
484     HTMLTable_get_borderColor,
485     HTMLTable_put_borderColorLight,
486     HTMLTable_get_borderColorLight,
487     HTMLTable_put_borderColorDark,
488     HTMLTable_get_borderColorDark,
489     HTMLTable_put_align,
490     HTMLTable_get_align,
491     HTMLTable_refresh,
492     HTMLTable_get_rows,
493     HTMLTable_put_width,
494     HTMLTable_get_width,
495     HTMLTable_put_height,
496     HTMLTable_get_height,
497     HTMLTable_put_dataPageSize,
498     HTMLTable_get_dataPageSize,
499     HTMLTable_nextPage,
500     HTMLTable_previousPage,
501     HTMLTable_get_tHead,
502     HTMLTable_get_tFoot,
503     HTMLTable_get_tBodies,
504     HTMLTable_get_caption,
505     HTMLTable_createTHead,
506     HTMLTable_deleteTHead,
507     HTMLTable_createTFoot,
508     HTMLTable_deleteTFoot,
509     HTMLTable_createCaption,
510     HTMLTable_deleteCaption,
511     HTMLTable_insertRow,
512     HTMLTable_deleteRow,
513     HTMLTable_get_readyState,
514     HTMLTable_put_onreadystatechange,
515     HTMLTable_get_onreadystatechange
516 };
517
518 static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
519 {
520     return CONTAINING_RECORD(iface, HTMLTable, element.node);
521 }
522
523 static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
524 {
525     HTMLTable *This = impl_from_HTMLDOMNode(iface);
526
527     *ppv = NULL;
528
529     if(IsEqualGUID(&IID_IUnknown, riid)) {
530         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
531         *ppv = &This->IHTMLTable_iface;
532     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
533         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
534         *ppv = &This->IHTMLTable_iface;
535     }else if(IsEqualGUID(&IID_IHTMLTable, riid)) {
536         TRACE("(%p)->(IID_IHTMLTable %p)\n", This, ppv);
537         *ppv = &This->IHTMLTable_iface;
538     }
539
540     if(*ppv) {
541         IUnknown_AddRef((IUnknown*)*ppv);
542         return S_OK;
543     }
544
545     return HTMLElement_QI(&This->element.node, riid, ppv);
546 }
547
548 static void HTMLTable_destructor(HTMLDOMNode *iface)
549 {
550     HTMLTable *This = impl_from_HTMLDOMNode(iface);
551
552     if(This->nstable)
553         nsIDOMHTMLTableElement_Release(This->nstable);
554
555     HTMLElement_destructor(&This->element.node);
556 }
557
558 static const NodeImplVtbl HTMLTableImplVtbl = {
559     HTMLTable_QI,
560     HTMLTable_destructor,
561     HTMLElement_clone,
562     HTMLElement_get_attr_col
563 };
564
565 static const tid_t HTMLTable_iface_tids[] = {
566     HTMLELEMENT_TIDS,
567     IHTMLTable_tid,
568     0
569 };
570
571 static dispex_static_data_t HTMLTable_dispex = {
572     NULL,
573     DispHTMLTable_tid,
574     NULL,
575     HTMLTable_iface_tids
576 };
577
578 HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
579 {
580     HTMLTable *ret;
581     nsresult nsres;
582
583     ret = heap_alloc_zero(sizeof(HTMLTable));
584     if(!ret)
585         return E_OUTOFMEMORY;
586
587     ret->element.node.vtbl = &HTMLTableImplVtbl;
588     ret->IHTMLTable_iface.lpVtbl = &HTMLTableVtbl;
589
590     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
591     if(NS_FAILED(nsres)) {
592         ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
593         heap_free(ret);
594         return E_FAIL;
595     }
596
597     HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
598     ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents, NULL);
599
600     *elem = &ret->element;
601     return S_OK;
602 }