2 * Copyright 2007,2008,2012 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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 struct HTMLTableCell
{
38 IHTMLTableCell IHTMLTableCell_iface
;
40 nsIDOMHTMLTableCellElement
*nscell
;
43 static inline HTMLTableCell
*impl_from_IHTMLTableCell(IHTMLTableCell
*iface
)
45 return CONTAINING_RECORD(iface
, HTMLTableCell
, IHTMLTableCell_iface
);
48 static HRESULT WINAPI
HTMLTableCell_QueryInterface(IHTMLTableCell
*iface
, REFIID riid
, void **ppv
)
50 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
52 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
55 static ULONG WINAPI
HTMLTableCell_AddRef(IHTMLTableCell
*iface
)
57 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
59 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
62 static ULONG WINAPI
HTMLTableCell_Release(IHTMLTableCell
*iface
)
64 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
66 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
69 static HRESULT WINAPI
HTMLTableCell_GetTypeInfoCount(IHTMLTableCell
*iface
, UINT
*pctinfo
)
71 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
72 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
75 static HRESULT WINAPI
HTMLTableCell_GetTypeInfo(IHTMLTableCell
*iface
, UINT iTInfo
,
76 LCID lcid
, ITypeInfo
**ppTInfo
)
78 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
79 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
83 static HRESULT WINAPI
HTMLTableCell_GetIDsOfNames(IHTMLTableCell
*iface
, REFIID riid
,
84 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
86 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
87 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
88 cNames
, lcid
, rgDispId
);
91 static HRESULT WINAPI
HTMLTableCell_Invoke(IHTMLTableCell
*iface
, DISPID dispIdMember
, REFIID riid
,
92 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
95 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
96 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
97 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
100 static HRESULT WINAPI
HTMLTableCell_put_rowSpan(IHTMLTableCell
*iface
, LONG v
)
102 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
105 TRACE("(%p)->(%d)\n", This
, v
);
110 nsres
= nsIDOMHTMLTableCellElement_SetRowSpan(This
->nscell
, v
);
111 if(NS_FAILED(nsres
)) {
112 ERR("SetRowSpan failed: %08x\n", nsres
);
119 static HRESULT WINAPI
HTMLTableCell_get_rowSpan(IHTMLTableCell
*iface
, LONG
*p
)
121 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
124 TRACE("(%p)->(%p)\n", This
, p
);
126 nsres
= nsIDOMHTMLTableCellElement_GetRowSpan(This
->nscell
, p
);
127 if(NS_FAILED(nsres
)) {
128 ERR("GetRowSpan failed: %08x\n", nsres
);
135 static HRESULT WINAPI
HTMLTableCell_put_colSpan(IHTMLTableCell
*iface
, LONG v
)
137 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
140 TRACE("(%p)->(%d)\n", This
, v
);
145 nsres
= nsIDOMHTMLTableCellElement_SetColSpan(This
->nscell
, v
);
146 if(NS_FAILED(nsres
)) {
147 ERR("SetColSpan failed: %08x\n", nsres
);
154 static HRESULT WINAPI
HTMLTableCell_get_colSpan(IHTMLTableCell
*iface
, LONG
*p
)
156 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
159 TRACE("(%p)->(%p)\n", This
, p
);
161 nsres
= nsIDOMHTMLTableCellElement_GetColSpan(This
->nscell
, p
);
162 if(NS_FAILED(nsres
)) {
163 ERR("GetColSpan failed: %08x\n", nsres
);
170 static HRESULT WINAPI
HTMLTableCell_put_align(IHTMLTableCell
*iface
, BSTR v
)
172 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
176 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
178 nsAString_InitDepend(&str
, v
);
179 nsres
= nsIDOMHTMLTableCellElement_SetAlign(This
->nscell
, &str
);
180 nsAString_Finish(&str
);
181 if (NS_FAILED(nsres
)) {
182 ERR("Set Align failed: %08x\n", nsres
);
188 static HRESULT WINAPI
HTMLTableCell_get_align(IHTMLTableCell
*iface
, BSTR
*p
)
190 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
194 TRACE("(%p)->(%p)\n", This
, p
);
196 nsAString_Init(&str
, NULL
);
197 nsres
= nsIDOMHTMLTableCellElement_GetAlign(This
->nscell
, &str
);
199 return return_nsstr(nsres
, &str
, p
);
202 static HRESULT WINAPI
HTMLTableCell_put_vAlign(IHTMLTableCell
*iface
, BSTR v
)
204 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
205 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
209 static HRESULT WINAPI
HTMLTableCell_get_vAlign(IHTMLTableCell
*iface
, BSTR
*p
)
211 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
212 FIXME("(%p)->(%p)\n", This
, p
);
216 static HRESULT WINAPI
HTMLTableCell_put_bgColor(IHTMLTableCell
*iface
, VARIANT v
)
218 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
222 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
224 if(!variant_to_nscolor(&v
, &strColor
))
227 nsres
= nsIDOMHTMLTableCellElement_SetBgColor(This
->nscell
, &strColor
);
228 nsAString_Finish(&strColor
);
229 if(NS_FAILED(nsres
)) {
230 ERR("SetBgColor(%s) failed: %08x\n", debugstr_variant(&v
), nsres
);
237 static HRESULT WINAPI
HTMLTableCell_get_bgColor(IHTMLTableCell
*iface
, VARIANT
*p
)
239 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
244 TRACE("(%p)->(%p)\n", This
, p
);
246 nsAString_Init(&strColor
, NULL
);
247 nsres
= nsIDOMHTMLTableCellElement_GetBgColor(This
->nscell
, &strColor
);
249 if(NS_SUCCEEDED(nsres
)) {
250 const PRUnichar
*color
;
251 nsAString_GetData(&strColor
, &color
);
253 hres
= nscolor_to_str(color
, &V_BSTR(p
));
255 ERR("GetBgColor failed: %08x\n", nsres
);
258 nsAString_Finish(&strColor
);
262 static HRESULT WINAPI
HTMLTableCell_put_noWrap(IHTMLTableCell
*iface
, VARIANT_BOOL v
)
264 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
265 FIXME("(%p)->(%x)\n", This
, v
);
269 static HRESULT WINAPI
HTMLTableCell_get_noWrap(IHTMLTableCell
*iface
, VARIANT_BOOL
*p
)
271 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
272 FIXME("(%p)->(%p)\n", This
, p
);
276 static HRESULT WINAPI
HTMLTableCell_put_background(IHTMLTableCell
*iface
, BSTR v
)
278 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
279 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
283 static HRESULT WINAPI
HTMLTableCell_get_background(IHTMLTableCell
*iface
, BSTR
*p
)
285 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
286 FIXME("(%p)->(%p)\n", This
, p
);
290 static HRESULT WINAPI
HTMLTableCell_put_borderColor(IHTMLTableCell
*iface
, VARIANT v
)
292 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
293 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
297 static HRESULT WINAPI
HTMLTableCell_get_borderColor(IHTMLTableCell
*iface
, VARIANT
*p
)
299 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
300 FIXME("(%p)->(%p)\n", This
, p
);
304 static HRESULT WINAPI
HTMLTableCell_put_borderColorLight(IHTMLTableCell
*iface
, VARIANT v
)
306 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
307 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
311 static HRESULT WINAPI
HTMLTableCell_get_borderColorLight(IHTMLTableCell
*iface
, VARIANT
*p
)
313 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
314 FIXME("(%p)->(%p)\n", This
, p
);
318 static HRESULT WINAPI
HTMLTableCell_put_borderColorDark(IHTMLTableCell
*iface
, VARIANT v
)
320 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
321 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
325 static HRESULT WINAPI
HTMLTableCell_get_borderColorDark(IHTMLTableCell
*iface
, VARIANT
*p
)
327 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
328 FIXME("(%p)->(%p)\n", This
, p
);
332 static HRESULT WINAPI
HTMLTableCell_put_width(IHTMLTableCell
*iface
, VARIANT v
)
334 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
335 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
339 static HRESULT WINAPI
HTMLTableCell_get_width(IHTMLTableCell
*iface
, VARIANT
*p
)
341 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
342 FIXME("(%p)->(%p)\n", This
, p
);
346 static HRESULT WINAPI
HTMLTableCell_put_height(IHTMLTableCell
*iface
, VARIANT v
)
348 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
349 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
353 static HRESULT WINAPI
HTMLTableCell_get_height(IHTMLTableCell
*iface
, VARIANT
*p
)
355 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
356 FIXME("(%p)->(%p)\n", This
, p
);
360 static HRESULT WINAPI
HTMLTableCell_get_cellIndex(IHTMLTableCell
*iface
, LONG
*p
)
362 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
365 TRACE("(%p)->(%p)\n", This
, p
);
366 nsres
= nsIDOMHTMLTableCellElement_GetCellIndex(This
->nscell
, p
);
367 if (NS_FAILED(nsres
)) {
368 ERR("Get CellIndex failed: %08x\n", nsres
);
375 static const IHTMLTableCellVtbl HTMLTableCellVtbl
= {
376 HTMLTableCell_QueryInterface
,
377 HTMLTableCell_AddRef
,
378 HTMLTableCell_Release
,
379 HTMLTableCell_GetTypeInfoCount
,
380 HTMLTableCell_GetTypeInfo
,
381 HTMLTableCell_GetIDsOfNames
,
382 HTMLTableCell_Invoke
,
383 HTMLTableCell_put_rowSpan
,
384 HTMLTableCell_get_rowSpan
,
385 HTMLTableCell_put_colSpan
,
386 HTMLTableCell_get_colSpan
,
387 HTMLTableCell_put_align
,
388 HTMLTableCell_get_align
,
389 HTMLTableCell_put_vAlign
,
390 HTMLTableCell_get_vAlign
,
391 HTMLTableCell_put_bgColor
,
392 HTMLTableCell_get_bgColor
,
393 HTMLTableCell_put_noWrap
,
394 HTMLTableCell_get_noWrap
,
395 HTMLTableCell_put_background
,
396 HTMLTableCell_get_background
,
397 HTMLTableCell_put_borderColor
,
398 HTMLTableCell_get_borderColor
,
399 HTMLTableCell_put_borderColorLight
,
400 HTMLTableCell_get_borderColorLight
,
401 HTMLTableCell_put_borderColorDark
,
402 HTMLTableCell_get_borderColorDark
,
403 HTMLTableCell_put_width
,
404 HTMLTableCell_get_width
,
405 HTMLTableCell_put_height
,
406 HTMLTableCell_get_height
,
407 HTMLTableCell_get_cellIndex
410 static inline HTMLTableCell
*HTMLTableCell_from_HTMLDOMNode(HTMLDOMNode
*iface
)
412 return CONTAINING_RECORD(iface
, HTMLTableCell
, element
.node
);
415 static HRESULT
HTMLTableCell_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
417 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
419 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
420 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
421 *ppv
= &This
->IHTMLTableCell_iface
;
422 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
423 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
424 *ppv
= &This
->IHTMLTableCell_iface
;
425 }else if(IsEqualGUID(&IID_IHTMLTableCell
, riid
)) {
426 TRACE("(%p)->(IID_IHTMLTableCell %p)\n", This
, ppv
);
427 *ppv
= &This
->IHTMLTableCell_iface
;
429 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
432 IUnknown_AddRef((IUnknown
*)*ppv
);
436 static void HTMLTableCell_destructor(HTMLDOMNode
*iface
)
438 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
440 HTMLElement_destructor(&This
->element
.node
);
443 static void HTMLTableCell_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
445 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
448 note_cc_edge((nsISupports
*)This
->nscell
, "This->nstablecell", cb
);
451 static void HTMLTableCell_unlink(HTMLDOMNode
*iface
)
453 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
456 nsIDOMHTMLTableCellElement
*nscell
= This
->nscell
;
459 nsIDOMHTMLTableCellElement_Release(nscell
);
463 static const NodeImplVtbl HTMLTableCellImplVtbl
= {
464 &CLSID_HTMLTableCell
,
466 HTMLTableCell_destructor
,
469 HTMLElement_handle_event
,
470 HTMLElement_get_attr_col
,
479 HTMLTableCell_traverse
,
483 static const tid_t HTMLTableCell_iface_tids
[] = {
489 static dispex_static_data_t HTMLTableCell_dispex
= {
491 DispHTMLTableCell_tid
,
492 HTMLTableCell_iface_tids
,
493 HTMLElement_init_dispex_info
496 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
501 ret
= heap_alloc_zero(sizeof(*ret
));
503 return E_OUTOFMEMORY
;
505 ret
->IHTMLTableCell_iface
.lpVtbl
= &HTMLTableCellVtbl
;
506 ret
->element
.node
.vtbl
= &HTMLTableCellImplVtbl
;
508 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableCell_dispex
);
510 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableCellElement
, (void**)&ret
->nscell
);
511 assert(nsres
== NS_OK
);
513 *elem
= &ret
->element
;
517 struct HTMLTableRow
{
520 IHTMLTableRow IHTMLTableRow_iface
;
522 nsIDOMHTMLTableRowElement
*nsrow
;
525 static inline HTMLTableRow
*impl_from_IHTMLTableRow(IHTMLTableRow
*iface
)
527 return CONTAINING_RECORD(iface
, HTMLTableRow
, IHTMLTableRow_iface
);
530 static HRESULT WINAPI
HTMLTableRow_QueryInterface(IHTMLTableRow
*iface
,
531 REFIID riid
, void **ppv
)
533 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
535 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
538 static ULONG WINAPI
HTMLTableRow_AddRef(IHTMLTableRow
*iface
)
540 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
542 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
545 static ULONG WINAPI
HTMLTableRow_Release(IHTMLTableRow
*iface
)
547 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
549 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
552 static HRESULT WINAPI
HTMLTableRow_GetTypeInfoCount(IHTMLTableRow
*iface
, UINT
*pctinfo
)
554 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
555 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
558 static HRESULT WINAPI
HTMLTableRow_GetTypeInfo(IHTMLTableRow
*iface
, UINT iTInfo
,
559 LCID lcid
, ITypeInfo
**ppTInfo
)
561 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
562 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
566 static HRESULT WINAPI
HTMLTableRow_GetIDsOfNames(IHTMLTableRow
*iface
, REFIID riid
,
567 LPOLESTR
*rgszNames
, UINT cNames
,
568 LCID lcid
, DISPID
*rgDispId
)
570 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
571 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
572 cNames
, lcid
, rgDispId
);
575 static HRESULT WINAPI
HTMLTableRow_Invoke(IHTMLTableRow
*iface
, DISPID dispIdMember
,
576 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
577 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
579 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
580 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
581 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
584 static HRESULT WINAPI
HTMLTableRow_put_align(IHTMLTableRow
*iface
, BSTR v
)
586 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
590 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
592 nsAString_InitDepend(&val
, v
);
594 nsres
= nsIDOMHTMLTableRowElement_SetAlign(This
->nsrow
, &val
);
595 nsAString_Finish(&val
);
596 if (NS_FAILED(nsres
)){
597 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
603 static HRESULT WINAPI
HTMLTableRow_get_align(IHTMLTableRow
*iface
, BSTR
*p
)
605 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
609 TRACE("(%p)->(%p)\n", This
, p
);
611 nsAString_Init(&val
, NULL
);
612 nsres
= nsIDOMHTMLTableRowElement_GetAlign(This
->nsrow
, &val
);
614 return return_nsstr(nsres
, &val
, p
);
617 static HRESULT WINAPI
HTMLTableRow_put_vAlign(IHTMLTableRow
*iface
, BSTR v
)
619 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
623 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
625 nsAString_InitDepend(&val
, v
);
627 nsres
= nsIDOMHTMLTableRowElement_SetVAlign(This
->nsrow
, &val
);
628 nsAString_Finish(&val
);
630 if (NS_FAILED(nsres
)){
631 ERR("Set VAlign(%s) failed!\n", debugstr_w(v
));
638 static HRESULT WINAPI
HTMLTableRow_get_vAlign(IHTMLTableRow
*iface
, BSTR
*p
)
640 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
644 TRACE("(%p)->(%p)\n", This
, p
);
646 nsAString_Init(&val
, NULL
);
647 nsres
= nsIDOMHTMLTableRowElement_GetVAlign(This
->nsrow
, &val
);
649 return return_nsstr(nsres
, &val
, p
);
652 static HRESULT WINAPI
HTMLTableRow_put_bgColor(IHTMLTableRow
*iface
, VARIANT v
)
654 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
658 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
660 if (!variant_to_nscolor(&v
, &val
))
663 nsres
= nsIDOMHTMLTableRowElement_SetBgColor(This
->nsrow
, &val
);
664 nsAString_Finish(&val
);
666 if (NS_FAILED(nsres
)){
667 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
674 static HRESULT WINAPI
HTMLTableRow_get_bgColor(IHTMLTableRow
*iface
, VARIANT
*p
)
676 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
680 const PRUnichar
*color
;
682 TRACE("(%p)->(%p)\n", This
, p
);
684 nsAString_Init(&strColor
, NULL
);
685 nsres
= nsIDOMHTMLTableRowElement_GetBgColor(This
->nsrow
, &strColor
);
687 if(NS_SUCCEEDED(nsres
)) {
688 nsAString_GetData(&strColor
, &color
);
690 hres
= nscolor_to_str(color
, &V_BSTR(p
));
692 ERR("SetBgColor failed: %08x\n", nsres
);
696 nsAString_Finish(&strColor
);
700 static HRESULT WINAPI
HTMLTableRow_put_borderColor(IHTMLTableRow
*iface
, VARIANT v
)
702 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
703 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
707 static HRESULT WINAPI
HTMLTableRow_get_borderColor(IHTMLTableRow
*iface
, VARIANT
*p
)
709 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
710 FIXME("(%p)->(%p)\n", This
, p
);
714 static HRESULT WINAPI
HTMLTableRow_put_borderColorLight(IHTMLTableRow
*iface
, VARIANT v
)
716 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
717 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
721 static HRESULT WINAPI
HTMLTableRow_get_borderColorLight(IHTMLTableRow
*iface
, VARIANT
*p
)
723 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
724 FIXME("(%p)->(%p)\n", This
, p
);
728 static HRESULT WINAPI
HTMLTableRow_put_borderColorDark(IHTMLTableRow
*iface
, VARIANT v
)
730 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
731 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
735 static HRESULT WINAPI
HTMLTableRow_get_borderColorDark(IHTMLTableRow
*iface
, VARIANT
*p
)
737 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
738 FIXME("(%p)->(%p)\n", This
, p
);
742 static HRESULT WINAPI
HTMLTableRow_get_rowIndex(IHTMLTableRow
*iface
, LONG
*p
)
744 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
747 TRACE("(%p)->(%p)\n", This
, p
);
748 nsres
= nsIDOMHTMLTableRowElement_GetRowIndex(This
->nsrow
, p
);
749 if(NS_FAILED(nsres
)) {
750 ERR("Get rowIndex failed: %08x\n", nsres
);
756 static HRESULT WINAPI
HTMLTableRow_get_sectionRowIndex(IHTMLTableRow
*iface
, LONG
*p
)
758 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
761 TRACE("(%p)->(%p)\n", This
, p
);
762 nsres
= nsIDOMHTMLTableRowElement_GetSectionRowIndex(This
->nsrow
, p
);
763 if(NS_FAILED(nsres
)) {
764 ERR("Get selectionRowIndex failed: %08x\n", nsres
);
770 static HRESULT WINAPI
HTMLTableRow_get_cells(IHTMLTableRow
*iface
, IHTMLElementCollection
**p
)
772 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
773 nsIDOMHTMLCollection
*nscol
;
776 TRACE("(%p)->(%p)\n", This
, p
);
778 nsres
= nsIDOMHTMLTableRowElement_GetCells(This
->nsrow
, &nscol
);
779 if(NS_FAILED(nsres
)) {
780 ERR("GetCells failed: %08x\n", nsres
);
784 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
786 nsIDOMHTMLCollection_Release(nscol
);
790 static HRESULT WINAPI
HTMLTableRow_insertCell(IHTMLTableRow
*iface
, LONG index
, IDispatch
**row
)
792 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
793 nsIDOMHTMLElement
*nselem
;
798 TRACE("(%p)->(%d %p)\n", This
, index
, row
);
799 nsres
= nsIDOMHTMLTableRowElement_InsertCell(This
->nsrow
, index
, &nselem
);
800 if(NS_FAILED(nsres
)) {
801 ERR("Insert Cell at %d failed: %08x\n", index
, nsres
);
805 hres
= HTMLTableCell_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
806 nsIDOMHTMLElement_Release(nselem
);
808 ERR("Create TableCell failed: %08x\n", hres
);
812 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
816 static HRESULT WINAPI
HTMLTableRow_deleteCell(IHTMLTableRow
*iface
, LONG index
)
818 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
821 TRACE("(%p)->(%d)\n", This
, index
);
822 nsres
= nsIDOMHTMLTableRowElement_DeleteCell(This
->nsrow
, index
);
823 if(NS_FAILED(nsres
)) {
824 ERR("Delete Cell failed: %08x\n", nsres
);
830 static const IHTMLTableRowVtbl HTMLTableRowVtbl
= {
831 HTMLTableRow_QueryInterface
,
833 HTMLTableRow_Release
,
834 HTMLTableRow_GetTypeInfoCount
,
835 HTMLTableRow_GetTypeInfo
,
836 HTMLTableRow_GetIDsOfNames
,
838 HTMLTableRow_put_align
,
839 HTMLTableRow_get_align
,
840 HTMLTableRow_put_vAlign
,
841 HTMLTableRow_get_vAlign
,
842 HTMLTableRow_put_bgColor
,
843 HTMLTableRow_get_bgColor
,
844 HTMLTableRow_put_borderColor
,
845 HTMLTableRow_get_borderColor
,
846 HTMLTableRow_put_borderColorLight
,
847 HTMLTableRow_get_borderColorLight
,
848 HTMLTableRow_put_borderColorDark
,
849 HTMLTableRow_get_borderColorDark
,
850 HTMLTableRow_get_rowIndex
,
851 HTMLTableRow_get_sectionRowIndex
,
852 HTMLTableRow_get_cells
,
853 HTMLTableRow_insertCell
,
854 HTMLTableRow_deleteCell
857 static inline HTMLTableRow
*HTMLTableRow_from_HTMLDOMNode(HTMLDOMNode
*iface
)
859 return CONTAINING_RECORD(iface
, HTMLTableRow
, element
.node
);
862 static HRESULT
HTMLTableRow_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
864 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
868 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
869 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
870 *ppv
= &This
->IHTMLTableRow_iface
;
871 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
872 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
873 *ppv
= &This
->IHTMLTableRow_iface
;
874 }else if(IsEqualGUID(&IID_IHTMLTableRow
, riid
)) {
875 TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This
, ppv
);
876 *ppv
= &This
->IHTMLTableRow_iface
;
880 IUnknown_AddRef((IUnknown
*)*ppv
);
884 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
887 static void HTMLTableRow_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
889 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
892 note_cc_edge((nsISupports
*)This
->nsrow
, "This->nstablerow", cb
);
895 static void HTMLTableRow_unlink(HTMLDOMNode
*iface
)
897 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
900 nsIDOMHTMLTableRowElement
*nsrow
= This
->nsrow
;
903 nsIDOMHTMLTableRowElement_Release(nsrow
);
907 static const NodeImplVtbl HTMLTableRowImplVtbl
= {
910 HTMLElement_destructor
,
913 HTMLElement_handle_event
,
914 HTMLElement_get_attr_col
,
923 HTMLTableRow_traverse
,
927 static const tid_t HTMLTableRow_iface_tids
[] = {
933 static dispex_static_data_t HTMLTableRow_dispex
= {
935 DispHTMLTableRow_tid
,
936 HTMLTableRow_iface_tids
,
937 HTMLElement_init_dispex_info
940 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
945 ret
= heap_alloc_zero(sizeof(HTMLTableRow
));
947 return E_OUTOFMEMORY
;
949 ret
->IHTMLTableRow_iface
.lpVtbl
= &HTMLTableRowVtbl
;
950 ret
->element
.node
.vtbl
= &HTMLTableRowImplVtbl
;
952 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableRow_dispex
);
954 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableRowElement
, (void**)&ret
->nsrow
);
955 assert(nsres
== NS_OK
);
957 *elem
= &ret
->element
;
964 IHTMLTable IHTMLTable_iface
;
965 IHTMLTable2 IHTMLTable2_iface
;
966 IHTMLTable3 IHTMLTable3_iface
;
968 nsIDOMHTMLTableElement
*nstable
;
971 static inline HTMLTable
*impl_from_IHTMLTable(IHTMLTable
*iface
)
973 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable_iface
);
976 static inline HTMLTable
*impl_from_IHTMLTable2(IHTMLTable2
*iface
)
978 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable2_iface
);
981 static inline HTMLTable
*impl_from_IHTMLTable3(IHTMLTable3
*iface
)
983 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable3_iface
);
986 static HRESULT
var2str(const VARIANT
*p
, nsAString
*nsstr
)
994 return nsAString_Init(nsstr
, V_BSTR(p
))?
995 S_OK
: E_OUTOFMEMORY
;
997 hres
= VarBstrFromR8(V_R8(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1000 hres
= VarBstrFromR4(V_R4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1003 hres
= VarBstrFromI4(V_I4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1006 FIXME("unsupported arg %s\n", debugstr_variant(p
));
1012 ret
= nsAString_Init(nsstr
, str
);
1014 return ret
? S_OK
: E_OUTOFMEMORY
;
1017 static HRESULT
nsstr_to_truncated_bstr(const nsAString
*nsstr
, BSTR
*ret_ptr
)
1019 const PRUnichar
*str
, *ptr
, *end
= NULL
;
1022 nsAString_GetData(nsstr
, &str
);
1024 for(ptr
= str
; isdigitW(*ptr
); ptr
++);
1026 for(end
= ptr
++; isdigitW(*ptr
); ptr
++);
1031 ret
= end
? SysAllocStringLen(str
, end
-str
) : SysAllocString(str
);
1034 return ret
? S_OK
: E_OUTOFMEMORY
;
1037 static HRESULT WINAPI
HTMLTable_QueryInterface(IHTMLTable
*iface
,
1038 REFIID riid
, void **ppv
)
1040 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1042 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1045 static ULONG WINAPI
HTMLTable_AddRef(IHTMLTable
*iface
)
1047 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1049 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1052 static ULONG WINAPI
HTMLTable_Release(IHTMLTable
*iface
)
1054 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1056 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1059 static HRESULT WINAPI
HTMLTable_GetTypeInfoCount(IHTMLTable
*iface
, UINT
*pctinfo
)
1061 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1062 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1065 static HRESULT WINAPI
HTMLTable_GetTypeInfo(IHTMLTable
*iface
, UINT iTInfo
,
1066 LCID lcid
, ITypeInfo
**ppTInfo
)
1068 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1069 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1073 static HRESULT WINAPI
HTMLTable_GetIDsOfNames(IHTMLTable
*iface
, REFIID riid
,
1074 LPOLESTR
*rgszNames
, UINT cNames
,
1075 LCID lcid
, DISPID
*rgDispId
)
1077 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1078 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1079 cNames
, lcid
, rgDispId
);
1082 static HRESULT WINAPI
HTMLTable_Invoke(IHTMLTable
*iface
, DISPID dispIdMember
,
1083 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1084 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1086 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1087 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1088 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1091 static HRESULT WINAPI
HTMLTable_put_cols(IHTMLTable
*iface
, LONG v
)
1093 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1094 FIXME("(%p)->(%d)\n", This
, v
);
1098 static HRESULT WINAPI
HTMLTable_get_cols(IHTMLTable
*iface
, LONG
*p
)
1100 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1101 FIXME("(%p)->(%p)\n", This
, p
);
1105 static HRESULT WINAPI
HTMLTable_put_border(IHTMLTable
*iface
, VARIANT v
)
1107 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1108 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1112 static HRESULT WINAPI
HTMLTable_get_border(IHTMLTable
*iface
, VARIANT
*p
)
1114 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1115 FIXME("(%p)->(%p)\n", This
, p
);
1119 static HRESULT WINAPI
HTMLTable_put_frame(IHTMLTable
*iface
, BSTR v
)
1121 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1125 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1127 nsAString_InitDepend(&str
, v
);
1128 nsres
= nsIDOMHTMLTableElement_SetFrame(This
->nstable
, &str
);
1129 nsAString_Finish(&str
);
1131 if (NS_FAILED(nsres
)) {
1132 ERR("SetFrame(%s) failed: %08x\n", debugstr_w(v
), nsres
);
1138 static HRESULT WINAPI
HTMLTable_get_frame(IHTMLTable
*iface
, BSTR
*p
)
1140 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1144 TRACE("(%p)->(%p)\n", This
, p
);
1146 nsAString_Init(&str
, NULL
);
1147 nsres
= nsIDOMHTMLTableElement_GetFrame(This
->nstable
, &str
);
1149 return return_nsstr(nsres
, &str
, p
);
1152 static HRESULT WINAPI
HTMLTable_put_rules(IHTMLTable
*iface
, BSTR v
)
1154 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1155 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1159 static HRESULT WINAPI
HTMLTable_get_rules(IHTMLTable
*iface
, BSTR
*p
)
1161 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1162 FIXME("(%p)->(%p)\n", This
, p
);
1166 static HRESULT WINAPI
HTMLTable_put_cellSpacing(IHTMLTable
*iface
, VARIANT v
)
1168 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1173 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1177 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
1180 static const WCHAR formatW
[] = {'%','d',0};
1181 sprintfW(buf
, formatW
, V_I4(&v
));
1182 nsAString_InitDepend(&nsstr
, buf
);
1186 FIXME("unsupported arg %s\n", debugstr_variant(&v
));
1190 nsres
= nsIDOMHTMLTableElement_SetCellSpacing(This
->nstable
, &nsstr
);
1191 nsAString_Finish(&nsstr
);
1192 if(NS_FAILED(nsres
)) {
1193 ERR("SetCellSpacing failed: %08x\n", nsres
);
1200 static HRESULT WINAPI
HTMLTable_get_cellSpacing(IHTMLTable
*iface
, VARIANT
*p
)
1202 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1206 TRACE("(%p)->(%p)\n", This
, p
);
1208 nsAString_Init(&nsstr
, NULL
);
1209 nsres
= nsIDOMHTMLTableElement_GetCellSpacing(This
->nstable
, &nsstr
);
1211 return return_nsstr(nsres
, &nsstr
, &V_BSTR(p
));
1214 static HRESULT WINAPI
HTMLTable_put_cellPadding(IHTMLTable
*iface
, VARIANT v
)
1216 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1221 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1223 hres
= var2str(&v
, &val
);
1227 nsres
= nsIDOMHTMLTableElement_SetCellPadding(This
->nstable
, &val
);
1228 nsAString_Finish(&val
);
1229 if(NS_FAILED(nsres
)) {
1230 ERR("Set Width(%s) failed, err = %08x\n", debugstr_variant(&v
), nsres
);
1237 static HRESULT WINAPI
HTMLTable_get_cellPadding(IHTMLTable
*iface
, VARIANT
*p
)
1239 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1243 TRACE("(%p)->(%p)\n", This
, p
);
1245 nsAString_Init(&val
, NULL
);
1246 nsres
= nsIDOMHTMLTableElement_GetCellPadding(This
->nstable
, &val
);
1247 return return_nsstr_variant(nsres
, &val
, p
);
1250 static HRESULT WINAPI
HTMLTable_put_background(IHTMLTable
*iface
, BSTR v
)
1252 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1253 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1257 static HRESULT WINAPI
HTMLTable_get_background(IHTMLTable
*iface
, BSTR
*p
)
1259 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1260 FIXME("(%p)->(%p)\n", This
, p
);
1264 static HRESULT WINAPI
HTMLTable_put_bgColor(IHTMLTable
*iface
, VARIANT v
)
1266 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1270 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1272 if(!variant_to_nscolor(&v
, &val
))
1275 nsres
= nsIDOMHTMLTableElement_SetBgColor(This
->nstable
, &val
);
1276 nsAString_Finish(&val
);
1277 if (NS_FAILED(nsres
)){
1278 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
1285 static HRESULT WINAPI
HTMLTable_get_bgColor(IHTMLTable
*iface
, VARIANT
*p
)
1287 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1291 const PRUnichar
*color
;
1293 TRACE("(%p)->(%p)\n", This
, p
);
1295 nsAString_Init(&strColor
, NULL
);
1296 nsres
= nsIDOMHTMLTableElement_GetBgColor(This
->nstable
, &strColor
);
1298 if(NS_SUCCEEDED(nsres
)) {
1299 nsAString_GetData(&strColor
, &color
);
1301 hres
= nscolor_to_str(color
, &V_BSTR(p
));
1303 ERR("SetBgColor failed: %08x\n", nsres
);
1307 nsAString_Finish(&strColor
);
1311 static HRESULT WINAPI
HTMLTable_put_borderColor(IHTMLTable
*iface
, VARIANT v
)
1313 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1314 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1318 static HRESULT WINAPI
HTMLTable_get_borderColor(IHTMLTable
*iface
, VARIANT
*p
)
1320 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1321 FIXME("(%p)->(%p)\n", This
, p
);
1325 static HRESULT WINAPI
HTMLTable_put_borderColorLight(IHTMLTable
*iface
, VARIANT v
)
1327 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1328 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1332 static HRESULT WINAPI
HTMLTable_get_borderColorLight(IHTMLTable
*iface
, VARIANT
*p
)
1334 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1335 FIXME("(%p)->(%p)\n", This
, p
);
1339 static HRESULT WINAPI
HTMLTable_put_borderColorDark(IHTMLTable
*iface
, VARIANT v
)
1341 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1342 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1346 static HRESULT WINAPI
HTMLTable_get_borderColorDark(IHTMLTable
*iface
, VARIANT
*p
)
1348 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1349 FIXME("(%p)->(%p)\n", This
, p
);
1353 static HRESULT WINAPI
HTMLTable_put_align(IHTMLTable
*iface
, BSTR v
)
1355 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1359 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1361 nsAString_InitDepend(&val
, v
);
1363 nsres
= nsIDOMHTMLTableElement_SetAlign(This
->nstable
, &val
);
1364 nsAString_Finish(&val
);
1365 if (NS_FAILED(nsres
)){
1366 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
1372 static HRESULT WINAPI
HTMLTable_get_align(IHTMLTable
*iface
, BSTR
*p
)
1374 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1378 TRACE("(%p)->(%p)\n", This
, p
);
1380 nsAString_Init(&val
, NULL
);
1381 nsres
= nsIDOMHTMLTableElement_GetAlign(This
->nstable
, &val
);
1383 return return_nsstr(nsres
, &val
, p
);
1386 static HRESULT WINAPI
HTMLTable_refresh(IHTMLTable
*iface
)
1388 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1389 FIXME("(%p)\n", This
);
1393 static HRESULT WINAPI
HTMLTable_get_rows(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1395 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1396 nsIDOMHTMLCollection
*nscol
;
1399 TRACE("(%p)->(%p)\n", This
, p
);
1401 nsres
= nsIDOMHTMLTableElement_GetRows(This
->nstable
, &nscol
);
1402 if(NS_FAILED(nsres
)) {
1403 ERR("GetRows failed: %08x\n", nsres
);
1407 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1409 nsIDOMHTMLCollection_Release(nscol
);
1413 static HRESULT WINAPI
HTMLTable_put_width(IHTMLTable
*iface
, VARIANT v
)
1415 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1420 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1421 hres
= var2str(&v
, &val
);
1424 ERR("Set Width(%s) failed when initializing a nsAString, err = %08x\n",
1425 debugstr_variant(&v
), hres
);
1429 nsres
= nsIDOMHTMLTableElement_SetWidth(This
->nstable
, &val
);
1430 nsAString_Finish(&val
);
1432 if (NS_FAILED(nsres
)){
1433 ERR("Set Width(%s) failed, err = %08x\n", debugstr_variant(&v
), nsres
);
1439 static HRESULT WINAPI
HTMLTable_get_width(IHTMLTable
*iface
, VARIANT
*p
)
1441 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1447 TRACE("(%p)->(%p)\n", This
, p
);
1448 nsAString_Init(&val
, NULL
);
1449 nsres
= nsIDOMHTMLTableElement_GetWidth(This
->nstable
, &val
);
1450 if (NS_FAILED(nsres
)){
1451 ERR("Get Width failed!\n");
1452 nsAString_Finish(&val
);
1456 hres
= nsstr_to_truncated_bstr(&val
, &bstr
);
1457 nsAString_Finish(&val
);
1464 static HRESULT WINAPI
HTMLTable_put_height(IHTMLTable
*iface
, VARIANT v
)
1466 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1467 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1471 static HRESULT WINAPI
HTMLTable_get_height(IHTMLTable
*iface
, VARIANT
*p
)
1473 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1474 FIXME("(%p)->(%p)\n", This
, p
);
1478 static HRESULT WINAPI
HTMLTable_put_dataPageSize(IHTMLTable
*iface
, LONG v
)
1480 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1481 FIXME("(%p)->(%d)\n", This
, v
);
1485 static HRESULT WINAPI
HTMLTable_get_dataPageSize(IHTMLTable
*iface
, LONG
*p
)
1487 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1488 FIXME("(%p)->(%p)\n", This
, p
);
1492 static HRESULT WINAPI
HTMLTable_nextPage(IHTMLTable
*iface
)
1494 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1495 FIXME("(%p)\n", This
);
1499 static HRESULT WINAPI
HTMLTable_previousPage(IHTMLTable
*iface
)
1501 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1502 FIXME("(%p)\n", This
);
1506 static HRESULT WINAPI
HTMLTable_get_tHead(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1508 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1509 FIXME("(%p)->(%p)\n", This
, p
);
1513 static HRESULT WINAPI
HTMLTable_get_tFoot(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1515 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1516 FIXME("(%p)->(%p)\n", This
, p
);
1520 static HRESULT WINAPI
HTMLTable_get_tBodies(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1522 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1523 nsIDOMHTMLCollection
*nscol
= NULL
;
1526 TRACE("(%p)->(%p)\n", This
, p
);
1528 nsres
= nsIDOMHTMLTableElement_GetTBodies(This
->nstable
, &nscol
);
1529 if(NS_FAILED(nsres
)) {
1530 ERR("GetTBodies failed: %08x\n", nsres
);
1534 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1536 nsIDOMHTMLCollection_Release(nscol
);
1540 static HRESULT WINAPI
HTMLTable_get_caption(IHTMLTable
*iface
, IHTMLTableCaption
**p
)
1542 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1543 FIXME("(%p)->(%p)\n", This
, p
);
1547 static HRESULT WINAPI
HTMLTable_createTHead(IHTMLTable
*iface
, IDispatch
**head
)
1549 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1550 FIXME("(%p)->(%p)\n", This
, head
);
1554 static HRESULT WINAPI
HTMLTable_deleteTHead(IHTMLTable
*iface
)
1556 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1557 FIXME("(%p)\n", This
);
1561 static HRESULT WINAPI
HTMLTable_createTFoot(IHTMLTable
*iface
, IDispatch
**foot
)
1563 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1564 FIXME("(%p)->(%p)\n", This
, foot
);
1568 static HRESULT WINAPI
HTMLTable_deleteTFoot(IHTMLTable
*iface
)
1570 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1571 FIXME("(%p)\n", This
);
1575 static HRESULT WINAPI
HTMLTable_createCaption(IHTMLTable
*iface
, IHTMLTableCaption
**caption
)
1577 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1578 FIXME("(%p)->(%p)\n", This
, caption
);
1582 static HRESULT WINAPI
HTMLTable_deleteCaption(IHTMLTable
*iface
)
1584 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1585 FIXME("(%p)\n", This
);
1589 static HRESULT WINAPI
HTMLTable_insertRow(IHTMLTable
*iface
, LONG index
, IDispatch
**row
)
1591 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1592 nsIDOMHTMLElement
*nselem
;
1597 TRACE("(%p)->(%d %p)\n", This
, index
, row
);
1598 nsres
= nsIDOMHTMLTableElement_InsertRow(This
->nstable
, index
, &nselem
);
1599 if(NS_FAILED(nsres
)) {
1600 ERR("Insert Row at %d failed: %08x\n", index
, nsres
);
1604 hres
= HTMLTableRow_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
1605 nsIDOMHTMLElement_Release(nselem
);
1607 ERR("Create TableRow failed: %08x\n", hres
);
1611 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
1615 static HRESULT WINAPI
HTMLTable_deleteRow(IHTMLTable
*iface
, LONG index
)
1617 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1620 TRACE("(%p)->(%d)\n", This
, index
);
1621 nsres
= nsIDOMHTMLTableElement_DeleteRow(This
->nstable
, index
);
1622 if(NS_FAILED(nsres
)) {
1623 ERR("Delete Row failed: %08x\n", nsres
);
1629 static HRESULT WINAPI
HTMLTable_get_readyState(IHTMLTable
*iface
, BSTR
*p
)
1631 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1632 FIXME("(%p)->(%p)\n", This
, p
);
1636 static HRESULT WINAPI
HTMLTable_put_onreadystatechange(IHTMLTable
*iface
, VARIANT v
)
1638 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1639 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1643 static HRESULT WINAPI
HTMLTable_get_onreadystatechange(IHTMLTable
*iface
, VARIANT
*p
)
1645 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1646 FIXME("(%p)->(%p)\n", This
, p
);
1650 static const IHTMLTableVtbl HTMLTableVtbl
= {
1651 HTMLTable_QueryInterface
,
1654 HTMLTable_GetTypeInfoCount
,
1655 HTMLTable_GetTypeInfo
,
1656 HTMLTable_GetIDsOfNames
,
1660 HTMLTable_put_border
,
1661 HTMLTable_get_border
,
1662 HTMLTable_put_frame
,
1663 HTMLTable_get_frame
,
1664 HTMLTable_put_rules
,
1665 HTMLTable_get_rules
,
1666 HTMLTable_put_cellSpacing
,
1667 HTMLTable_get_cellSpacing
,
1668 HTMLTable_put_cellPadding
,
1669 HTMLTable_get_cellPadding
,
1670 HTMLTable_put_background
,
1671 HTMLTable_get_background
,
1672 HTMLTable_put_bgColor
,
1673 HTMLTable_get_bgColor
,
1674 HTMLTable_put_borderColor
,
1675 HTMLTable_get_borderColor
,
1676 HTMLTable_put_borderColorLight
,
1677 HTMLTable_get_borderColorLight
,
1678 HTMLTable_put_borderColorDark
,
1679 HTMLTable_get_borderColorDark
,
1680 HTMLTable_put_align
,
1681 HTMLTable_get_align
,
1684 HTMLTable_put_width
,
1685 HTMLTable_get_width
,
1686 HTMLTable_put_height
,
1687 HTMLTable_get_height
,
1688 HTMLTable_put_dataPageSize
,
1689 HTMLTable_get_dataPageSize
,
1691 HTMLTable_previousPage
,
1692 HTMLTable_get_tHead
,
1693 HTMLTable_get_tFoot
,
1694 HTMLTable_get_tBodies
,
1695 HTMLTable_get_caption
,
1696 HTMLTable_createTHead
,
1697 HTMLTable_deleteTHead
,
1698 HTMLTable_createTFoot
,
1699 HTMLTable_deleteTFoot
,
1700 HTMLTable_createCaption
,
1701 HTMLTable_deleteCaption
,
1702 HTMLTable_insertRow
,
1703 HTMLTable_deleteRow
,
1704 HTMLTable_get_readyState
,
1705 HTMLTable_put_onreadystatechange
,
1706 HTMLTable_get_onreadystatechange
1710 static HRESULT WINAPI
HTMLTable2_QueryInterface(IHTMLTable2
*iface
,
1711 REFIID riid
, void **ppv
)
1713 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1715 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1718 static ULONG WINAPI
HTMLTable2_AddRef(IHTMLTable2
*iface
)
1720 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1722 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1725 static ULONG WINAPI
HTMLTable2_Release(IHTMLTable2
*iface
)
1727 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1729 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1732 static HRESULT WINAPI
HTMLTable2_GetTypeInfoCount(IHTMLTable2
*iface
, UINT
*pctinfo
)
1734 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1735 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1738 static HRESULT WINAPI
HTMLTable2_GetTypeInfo(IHTMLTable2
*iface
, UINT iTInfo
,
1739 LCID lcid
, ITypeInfo
**ppTInfo
)
1741 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1742 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1746 static HRESULT WINAPI
HTMLTable2_GetIDsOfNames(IHTMLTable2
*iface
, REFIID riid
,
1747 LPOLESTR
*rgszNames
, UINT cNames
,
1748 LCID lcid
, DISPID
*rgDispId
)
1750 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1751 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1752 cNames
, lcid
, rgDispId
);
1755 static HRESULT WINAPI
HTMLTable2_Invoke(IHTMLTable2
*iface
, DISPID dispIdMember
,
1756 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1757 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1759 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1760 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1761 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1764 static HRESULT WINAPI
HTMLTable2_firstPage(IHTMLTable2
*iface
)
1766 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1767 FIXME("(%p)->()\n", This
);
1771 static HRESULT WINAPI
HTMLTable2_lastPage(IHTMLTable2
*iface
)
1773 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1774 FIXME("(%p)->()\n", This
);
1778 static HRESULT WINAPI
HTMLTable2_cells(IHTMLTable2
*iface
, IHTMLElementCollection
**p
)
1780 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1781 FIXME("(%p)->(%p)\n", This
, p
);
1785 static HRESULT WINAPI
HTMLTable2_moveRow(IHTMLTable2
*iface
, LONG indexFrom
, LONG indexTo
, IDispatch
**row
)
1787 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1788 FIXME("(%p)->(%d %d %p)\n", This
, indexFrom
, indexTo
, row
);
1793 static const IHTMLTable2Vtbl HTMLTable2Vtbl
= {
1794 HTMLTable2_QueryInterface
,
1797 HTMLTable2_GetTypeInfoCount
,
1798 HTMLTable2_GetTypeInfo
,
1799 HTMLTable2_GetIDsOfNames
,
1801 HTMLTable2_firstPage
,
1802 HTMLTable2_lastPage
,
1808 static HRESULT WINAPI
HTMLTable3_QueryInterface(IHTMLTable3
*iface
,
1809 REFIID riid
, void **ppv
)
1811 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1813 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1816 static ULONG WINAPI
HTMLTable3_AddRef(IHTMLTable3
*iface
)
1818 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1820 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1823 static ULONG WINAPI
HTMLTable3_Release(IHTMLTable3
*iface
)
1825 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1827 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1830 static HRESULT WINAPI
HTMLTable3_GetTypeInfoCount(IHTMLTable3
*iface
, UINT
*pctinfo
)
1832 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1833 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1836 static HRESULT WINAPI
HTMLTable3_GetTypeInfo(IHTMLTable3
*iface
, UINT iTInfo
,
1837 LCID lcid
, ITypeInfo
**ppTInfo
)
1839 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1840 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1844 static HRESULT WINAPI
HTMLTable3_GetIDsOfNames(IHTMLTable3
*iface
, REFIID riid
,
1845 LPOLESTR
*rgszNames
, UINT cNames
,
1846 LCID lcid
, DISPID
*rgDispId
)
1848 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1849 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1850 cNames
, lcid
, rgDispId
);
1853 static HRESULT WINAPI
HTMLTable3_Invoke(IHTMLTable3
*iface
, DISPID dispIdMember
,
1854 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1855 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1857 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1858 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1859 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1862 static HRESULT WINAPI
HTMLTable3_put_summary(IHTMLTable3
*iface
, BSTR v
)
1864 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1868 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1870 nsAString_InitDepend(&str
, v
);
1872 nsres
= nsIDOMHTMLTableElement_SetSummary(This
->nstable
, &str
);
1874 nsAString_Finish(&str
);
1875 if (NS_FAILED(nsres
)) {
1876 ERR("Set summary(%s) failed: %08x\n", debugstr_w(v
), nsres
);
1882 static HRESULT WINAPI
HTMLTable3_get_summary(IHTMLTable3
*iface
, BSTR
* p
)
1884 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1888 TRACE("(%p)->(%p)\n", This
, p
);
1890 nsAString_Init(&str
, NULL
);
1891 nsres
= nsIDOMHTMLTableElement_GetSummary(This
->nstable
, &str
);
1893 return return_nsstr(nsres
, &str
, p
);
1896 static const IHTMLTable3Vtbl HTMLTable3Vtbl
= {
1897 HTMLTable3_QueryInterface
,
1900 HTMLTable3_GetTypeInfoCount
,
1901 HTMLTable3_GetTypeInfo
,
1902 HTMLTable3_GetIDsOfNames
,
1904 HTMLTable3_put_summary
,
1905 HTMLTable3_get_summary
1908 static inline HTMLTable
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1910 return CONTAINING_RECORD(iface
, HTMLTable
, element
.node
);
1913 static HRESULT
HTMLTable_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1915 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1919 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1920 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1921 *ppv
= &This
->IHTMLTable_iface
;
1922 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1923 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1924 *ppv
= &This
->IHTMLTable_iface
;
1925 }else if(IsEqualGUID(&IID_IHTMLTable
, riid
)) {
1926 TRACE("(%p)->(IID_IHTMLTable %p)\n", This
, ppv
);
1927 *ppv
= &This
->IHTMLTable_iface
;
1928 }else if(IsEqualGUID(&IID_IHTMLTable2
, riid
)) {
1929 TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This
, ppv
);
1930 *ppv
= &This
->IHTMLTable2_iface
;
1931 }else if(IsEqualGUID(&IID_IHTMLTable3
, riid
)) {
1932 TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This
, ppv
);
1933 *ppv
= &This
->IHTMLTable3_iface
;
1937 IUnknown_AddRef((IUnknown
*)*ppv
);
1941 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1944 static void HTMLTable_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
1946 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1949 note_cc_edge((nsISupports
*)This
->nstable
, "This->nstable", cb
);
1952 static void HTMLTable_unlink(HTMLDOMNode
*iface
)
1954 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1957 nsIDOMHTMLTableElement
*nstable
= This
->nstable
;
1959 This
->nstable
= NULL
;
1960 nsIDOMHTMLTableElement_Release(nstable
);
1964 static const cpc_entry_t HTMLTable_cpc
[] = {
1965 {&DIID_HTMLTableEvents
},
1970 static const NodeImplVtbl HTMLTableImplVtbl
= {
1973 HTMLElement_destructor
,
1976 HTMLElement_handle_event
,
1977 HTMLElement_get_attr_col
,
1990 static const tid_t HTMLTable_iface_tids
[] = {
1998 static dispex_static_data_t HTMLTable_dispex
= {
2001 HTMLTable_iface_tids
,
2002 HTMLElement_init_dispex_info
2005 HRESULT
HTMLTable_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
2010 ret
= heap_alloc_zero(sizeof(HTMLTable
));
2012 return E_OUTOFMEMORY
;
2014 ret
->element
.node
.vtbl
= &HTMLTableImplVtbl
;
2015 ret
->IHTMLTable_iface
.lpVtbl
= &HTMLTableVtbl
;
2016 ret
->IHTMLTable2_iface
.lpVtbl
= &HTMLTable2Vtbl
;
2017 ret
->IHTMLTable3_iface
.lpVtbl
= &HTMLTable3Vtbl
;
2019 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTable_dispex
);
2021 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableElement
, (void**)&ret
->nstable
);
2022 assert(nsres
== NS_OK
);
2024 *elem
= &ret
->element
;