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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.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)->(%ld)\n", This
, v
);
110 nsres
= nsIDOMHTMLTableCellElement_SetRowSpan(This
->nscell
, v
);
111 if(NS_FAILED(nsres
)) {
112 ERR("SetRowSpan failed: %08lx\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: %08lx\n", nsres
);
135 static HRESULT WINAPI
HTMLTableCell_put_colSpan(IHTMLTableCell
*iface
, LONG v
)
137 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
140 TRACE("(%p)->(%ld)\n", This
, v
);
145 nsres
= nsIDOMHTMLTableCellElement_SetColSpan(This
->nscell
, v
);
146 if(NS_FAILED(nsres
)) {
147 ERR("SetColSpan failed: %08lx\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: %08lx\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: %08lx\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: %08lx\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: %08lx\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
);
339 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
341 hres
= variant_to_nsstr(&v
, FALSE
, &nsstr
);
345 nsres
= nsIDOMHTMLTableCellElement_SetWidth(This
->nscell
, &nsstr
);
346 nsAString_Finish(&nsstr
);
347 return map_nsresult(nsres
);
350 static HRESULT WINAPI
HTMLTableCell_get_width(IHTMLTableCell
*iface
, VARIANT
*p
)
352 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
356 TRACE("(%p)->(%p)\n", This
, p
);
358 nsAString_Init(&nsstr
, NULL
);
359 nsres
= nsIDOMHTMLTableCellElement_GetWidth(This
->nscell
, &nsstr
);
360 return return_nsstr_variant(nsres
, &nsstr
, NSSTR_IMPLICIT_PX
, p
);
363 static HRESULT WINAPI
HTMLTableCell_put_height(IHTMLTableCell
*iface
, VARIANT v
)
365 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
370 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
372 hres
= variant_to_nsstr(&v
, FALSE
, &nsstr
);
376 nsres
= nsIDOMHTMLTableCellElement_SetHeight(This
->nscell
, &nsstr
);
377 nsAString_Finish(&nsstr
);
378 return map_nsresult(nsres
);
381 static HRESULT WINAPI
HTMLTableCell_get_height(IHTMLTableCell
*iface
, VARIANT
*p
)
383 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
387 TRACE("(%p)->(%p)\n", This
, p
);
389 nsAString_Init(&nsstr
, NULL
);
390 nsres
= nsIDOMHTMLTableCellElement_GetHeight(This
->nscell
, &nsstr
);
391 return return_nsstr_variant(nsres
, &nsstr
, NSSTR_IMPLICIT_PX
, p
);
394 static HRESULT WINAPI
HTMLTableCell_get_cellIndex(IHTMLTableCell
*iface
, LONG
*p
)
396 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
399 TRACE("(%p)->(%p)\n", This
, p
);
400 nsres
= nsIDOMHTMLTableCellElement_GetCellIndex(This
->nscell
, p
);
401 if (NS_FAILED(nsres
)) {
402 ERR("Get CellIndex failed: %08lx\n", nsres
);
409 static const IHTMLTableCellVtbl HTMLTableCellVtbl
= {
410 HTMLTableCell_QueryInterface
,
411 HTMLTableCell_AddRef
,
412 HTMLTableCell_Release
,
413 HTMLTableCell_GetTypeInfoCount
,
414 HTMLTableCell_GetTypeInfo
,
415 HTMLTableCell_GetIDsOfNames
,
416 HTMLTableCell_Invoke
,
417 HTMLTableCell_put_rowSpan
,
418 HTMLTableCell_get_rowSpan
,
419 HTMLTableCell_put_colSpan
,
420 HTMLTableCell_get_colSpan
,
421 HTMLTableCell_put_align
,
422 HTMLTableCell_get_align
,
423 HTMLTableCell_put_vAlign
,
424 HTMLTableCell_get_vAlign
,
425 HTMLTableCell_put_bgColor
,
426 HTMLTableCell_get_bgColor
,
427 HTMLTableCell_put_noWrap
,
428 HTMLTableCell_get_noWrap
,
429 HTMLTableCell_put_background
,
430 HTMLTableCell_get_background
,
431 HTMLTableCell_put_borderColor
,
432 HTMLTableCell_get_borderColor
,
433 HTMLTableCell_put_borderColorLight
,
434 HTMLTableCell_get_borderColorLight
,
435 HTMLTableCell_put_borderColorDark
,
436 HTMLTableCell_get_borderColorDark
,
437 HTMLTableCell_put_width
,
438 HTMLTableCell_get_width
,
439 HTMLTableCell_put_height
,
440 HTMLTableCell_get_height
,
441 HTMLTableCell_get_cellIndex
444 static inline HTMLTableCell
*HTMLTableCell_from_HTMLDOMNode(HTMLDOMNode
*iface
)
446 return CONTAINING_RECORD(iface
, HTMLTableCell
, element
.node
);
449 static HRESULT
HTMLTableCell_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
451 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
453 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
454 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
455 *ppv
= &This
->IHTMLTableCell_iface
;
456 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
457 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
458 *ppv
= &This
->IHTMLTableCell_iface
;
459 }else if(IsEqualGUID(&IID_IHTMLTableCell
, riid
)) {
460 TRACE("(%p)->(IID_IHTMLTableCell %p)\n", This
, ppv
);
461 *ppv
= &This
->IHTMLTableCell_iface
;
463 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
466 IUnknown_AddRef((IUnknown
*)*ppv
);
470 static void HTMLTableCell_destructor(HTMLDOMNode
*iface
)
472 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
474 HTMLElement_destructor(&This
->element
.node
);
477 static void HTMLTableCell_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
479 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
482 note_cc_edge((nsISupports
*)This
->nscell
, "This->nstablecell", cb
);
485 static void HTMLTableCell_unlink(HTMLDOMNode
*iface
)
487 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
488 unlink_ref(&This
->nscell
);
491 static const NodeImplVtbl HTMLTableCellImplVtbl
= {
492 .clsid
= &CLSID_HTMLTableCell
,
493 .qi
= HTMLTableCell_QI
,
494 .destructor
= HTMLTableCell_destructor
,
495 .cpc_entries
= HTMLElement_cpc
,
496 .clone
= HTMLElement_clone
,
497 .handle_event
= HTMLElement_handle_event
,
498 .get_attr_col
= HTMLElement_get_attr_col
,
499 .traverse
= HTMLTableCell_traverse
,
500 .unlink
= HTMLTableCell_unlink
503 static const tid_t HTMLTableCell_iface_tids
[] = {
509 static dispex_static_data_t HTMLTableCell_dispex
= {
510 "HTMLTableDataCellElement",
511 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
512 DispHTMLTableCell_tid
,
513 HTMLTableCell_iface_tids
,
514 HTMLElement_init_dispex_info
517 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
522 ret
= calloc(1, sizeof(*ret
));
524 return E_OUTOFMEMORY
;
526 ret
->IHTMLTableCell_iface
.lpVtbl
= &HTMLTableCellVtbl
;
527 ret
->element
.node
.vtbl
= &HTMLTableCellImplVtbl
;
529 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableCell_dispex
);
531 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableCellElement
, (void**)&ret
->nscell
);
532 assert(nsres
== NS_OK
);
534 *elem
= &ret
->element
;
538 struct HTMLTableRow
{
541 IHTMLTableRow IHTMLTableRow_iface
;
543 nsIDOMHTMLTableRowElement
*nsrow
;
546 static inline HTMLTableRow
*impl_from_IHTMLTableRow(IHTMLTableRow
*iface
)
548 return CONTAINING_RECORD(iface
, HTMLTableRow
, IHTMLTableRow_iface
);
551 static HRESULT WINAPI
HTMLTableRow_QueryInterface(IHTMLTableRow
*iface
,
552 REFIID riid
, void **ppv
)
554 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
556 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
559 static ULONG WINAPI
HTMLTableRow_AddRef(IHTMLTableRow
*iface
)
561 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
563 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
566 static ULONG WINAPI
HTMLTableRow_Release(IHTMLTableRow
*iface
)
568 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
570 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
573 static HRESULT WINAPI
HTMLTableRow_GetTypeInfoCount(IHTMLTableRow
*iface
, UINT
*pctinfo
)
575 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
576 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
579 static HRESULT WINAPI
HTMLTableRow_GetTypeInfo(IHTMLTableRow
*iface
, UINT iTInfo
,
580 LCID lcid
, ITypeInfo
**ppTInfo
)
582 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
583 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
587 static HRESULT WINAPI
HTMLTableRow_GetIDsOfNames(IHTMLTableRow
*iface
, REFIID riid
,
588 LPOLESTR
*rgszNames
, UINT cNames
,
589 LCID lcid
, DISPID
*rgDispId
)
591 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
592 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
593 cNames
, lcid
, rgDispId
);
596 static HRESULT WINAPI
HTMLTableRow_Invoke(IHTMLTableRow
*iface
, DISPID dispIdMember
,
597 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
598 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
600 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
601 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
602 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
605 static HRESULT WINAPI
HTMLTableRow_put_align(IHTMLTableRow
*iface
, BSTR v
)
607 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
611 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
613 nsAString_InitDepend(&val
, v
);
615 nsres
= nsIDOMHTMLTableRowElement_SetAlign(This
->nsrow
, &val
);
616 nsAString_Finish(&val
);
617 if (NS_FAILED(nsres
)){
618 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
624 static HRESULT WINAPI
HTMLTableRow_get_align(IHTMLTableRow
*iface
, BSTR
*p
)
626 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
630 TRACE("(%p)->(%p)\n", This
, p
);
632 nsAString_Init(&val
, NULL
);
633 nsres
= nsIDOMHTMLTableRowElement_GetAlign(This
->nsrow
, &val
);
635 return return_nsstr(nsres
, &val
, p
);
638 static HRESULT WINAPI
HTMLTableRow_put_vAlign(IHTMLTableRow
*iface
, BSTR v
)
640 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
644 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
646 nsAString_InitDepend(&val
, v
);
648 nsres
= nsIDOMHTMLTableRowElement_SetVAlign(This
->nsrow
, &val
);
649 nsAString_Finish(&val
);
651 if (NS_FAILED(nsres
)){
652 ERR("Set VAlign(%s) failed!\n", debugstr_w(v
));
659 static HRESULT WINAPI
HTMLTableRow_get_vAlign(IHTMLTableRow
*iface
, BSTR
*p
)
661 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
665 TRACE("(%p)->(%p)\n", This
, p
);
667 nsAString_Init(&val
, NULL
);
668 nsres
= nsIDOMHTMLTableRowElement_GetVAlign(This
->nsrow
, &val
);
670 return return_nsstr(nsres
, &val
, p
);
673 static HRESULT WINAPI
HTMLTableRow_put_bgColor(IHTMLTableRow
*iface
, VARIANT v
)
675 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
679 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
681 if (!variant_to_nscolor(&v
, &val
))
684 nsres
= nsIDOMHTMLTableRowElement_SetBgColor(This
->nsrow
, &val
);
685 nsAString_Finish(&val
);
687 if (NS_FAILED(nsres
)){
688 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
695 static HRESULT WINAPI
HTMLTableRow_get_bgColor(IHTMLTableRow
*iface
, VARIANT
*p
)
697 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
701 const PRUnichar
*color
;
703 TRACE("(%p)->(%p)\n", This
, p
);
705 nsAString_Init(&strColor
, NULL
);
706 nsres
= nsIDOMHTMLTableRowElement_GetBgColor(This
->nsrow
, &strColor
);
708 if(NS_SUCCEEDED(nsres
)) {
709 nsAString_GetData(&strColor
, &color
);
711 hres
= nscolor_to_str(color
, &V_BSTR(p
));
713 ERR("SetBgColor failed: %08lx\n", nsres
);
717 nsAString_Finish(&strColor
);
721 static HRESULT WINAPI
HTMLTableRow_put_borderColor(IHTMLTableRow
*iface
, VARIANT v
)
723 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
724 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
728 static HRESULT WINAPI
HTMLTableRow_get_borderColor(IHTMLTableRow
*iface
, VARIANT
*p
)
730 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
731 FIXME("(%p)->(%p)\n", This
, p
);
735 static HRESULT WINAPI
HTMLTableRow_put_borderColorLight(IHTMLTableRow
*iface
, VARIANT v
)
737 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
738 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
742 static HRESULT WINAPI
HTMLTableRow_get_borderColorLight(IHTMLTableRow
*iface
, VARIANT
*p
)
744 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
745 FIXME("(%p)->(%p)\n", This
, p
);
749 static HRESULT WINAPI
HTMLTableRow_put_borderColorDark(IHTMLTableRow
*iface
, VARIANT v
)
751 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
752 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
756 static HRESULT WINAPI
HTMLTableRow_get_borderColorDark(IHTMLTableRow
*iface
, VARIANT
*p
)
758 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
759 FIXME("(%p)->(%p)\n", This
, p
);
763 static HRESULT WINAPI
HTMLTableRow_get_rowIndex(IHTMLTableRow
*iface
, LONG
*p
)
765 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
768 TRACE("(%p)->(%p)\n", This
, p
);
769 nsres
= nsIDOMHTMLTableRowElement_GetRowIndex(This
->nsrow
, p
);
770 if(NS_FAILED(nsres
)) {
771 ERR("Get rowIndex failed: %08lx\n", nsres
);
777 static HRESULT WINAPI
HTMLTableRow_get_sectionRowIndex(IHTMLTableRow
*iface
, LONG
*p
)
779 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
782 TRACE("(%p)->(%p)\n", This
, p
);
783 nsres
= nsIDOMHTMLTableRowElement_GetSectionRowIndex(This
->nsrow
, p
);
784 if(NS_FAILED(nsres
)) {
785 ERR("Get selectionRowIndex failed: %08lx\n", nsres
);
791 static HRESULT WINAPI
HTMLTableRow_get_cells(IHTMLTableRow
*iface
, IHTMLElementCollection
**p
)
793 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
794 nsIDOMHTMLCollection
*nscol
;
797 TRACE("(%p)->(%p)\n", This
, p
);
799 nsres
= nsIDOMHTMLTableRowElement_GetCells(This
->nsrow
, &nscol
);
800 if(NS_FAILED(nsres
)) {
801 ERR("GetCells failed: %08lx\n", nsres
);
805 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
807 nsIDOMHTMLCollection_Release(nscol
);
811 static HRESULT WINAPI
HTMLTableRow_insertCell(IHTMLTableRow
*iface
, LONG index
, IDispatch
**row
)
813 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
814 nsIDOMHTMLElement
*nselem
;
819 TRACE("(%p)->(%ld %p)\n", This
, index
, row
);
820 nsres
= nsIDOMHTMLTableRowElement_InsertCell(This
->nsrow
, index
, &nselem
);
821 if(NS_FAILED(nsres
)) {
822 ERR("Insert Cell at %ld failed: %08lx\n", index
, nsres
);
826 hres
= HTMLTableCell_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
827 nsIDOMHTMLElement_Release(nselem
);
829 ERR("Create TableCell failed: %08lx\n", hres
);
833 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
837 static HRESULT WINAPI
HTMLTableRow_deleteCell(IHTMLTableRow
*iface
, LONG index
)
839 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
842 TRACE("(%p)->(%ld)\n", This
, index
);
843 nsres
= nsIDOMHTMLTableRowElement_DeleteCell(This
->nsrow
, index
);
844 if(NS_FAILED(nsres
)) {
845 ERR("Delete Cell failed: %08lx\n", nsres
);
851 static const IHTMLTableRowVtbl HTMLTableRowVtbl
= {
852 HTMLTableRow_QueryInterface
,
854 HTMLTableRow_Release
,
855 HTMLTableRow_GetTypeInfoCount
,
856 HTMLTableRow_GetTypeInfo
,
857 HTMLTableRow_GetIDsOfNames
,
859 HTMLTableRow_put_align
,
860 HTMLTableRow_get_align
,
861 HTMLTableRow_put_vAlign
,
862 HTMLTableRow_get_vAlign
,
863 HTMLTableRow_put_bgColor
,
864 HTMLTableRow_get_bgColor
,
865 HTMLTableRow_put_borderColor
,
866 HTMLTableRow_get_borderColor
,
867 HTMLTableRow_put_borderColorLight
,
868 HTMLTableRow_get_borderColorLight
,
869 HTMLTableRow_put_borderColorDark
,
870 HTMLTableRow_get_borderColorDark
,
871 HTMLTableRow_get_rowIndex
,
872 HTMLTableRow_get_sectionRowIndex
,
873 HTMLTableRow_get_cells
,
874 HTMLTableRow_insertCell
,
875 HTMLTableRow_deleteCell
878 static inline HTMLTableRow
*HTMLTableRow_from_HTMLDOMNode(HTMLDOMNode
*iface
)
880 return CONTAINING_RECORD(iface
, HTMLTableRow
, element
.node
);
883 static HRESULT
HTMLTableRow_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
885 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
889 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
890 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
891 *ppv
= &This
->IHTMLTableRow_iface
;
892 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
893 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
894 *ppv
= &This
->IHTMLTableRow_iface
;
895 }else if(IsEqualGUID(&IID_IHTMLTableRow
, riid
)) {
896 TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This
, ppv
);
897 *ppv
= &This
->IHTMLTableRow_iface
;
901 IUnknown_AddRef((IUnknown
*)*ppv
);
905 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
908 static void HTMLTableRow_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
910 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
913 note_cc_edge((nsISupports
*)This
->nsrow
, "This->nstablerow", cb
);
916 static void HTMLTableRow_unlink(HTMLDOMNode
*iface
)
918 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
919 unlink_ref(&This
->nsrow
);
922 static const NodeImplVtbl HTMLTableRowImplVtbl
= {
923 .clsid
= &CLSID_HTMLTableRow
,
924 .qi
= HTMLTableRow_QI
,
925 .destructor
= HTMLElement_destructor
,
926 .cpc_entries
= HTMLElement_cpc
,
927 .clone
= HTMLElement_clone
,
928 .handle_event
= HTMLElement_handle_event
,
929 .get_attr_col
= HTMLElement_get_attr_col
,
930 .traverse
= HTMLTableRow_traverse
,
931 .unlink
= HTMLTableRow_unlink
934 static const tid_t HTMLTableRow_iface_tids
[] = {
940 static dispex_static_data_t HTMLTableRow_dispex
= {
941 "HTMLTableRowElement",
942 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
943 DispHTMLTableRow_tid
,
944 HTMLTableRow_iface_tids
,
945 HTMLElement_init_dispex_info
948 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
953 ret
= calloc(1, sizeof(HTMLTableRow
));
955 return E_OUTOFMEMORY
;
957 ret
->IHTMLTableRow_iface
.lpVtbl
= &HTMLTableRowVtbl
;
958 ret
->element
.node
.vtbl
= &HTMLTableRowImplVtbl
;
960 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableRow_dispex
);
962 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableRowElement
, (void**)&ret
->nsrow
);
963 assert(nsres
== NS_OK
);
965 *elem
= &ret
->element
;
972 IHTMLTable IHTMLTable_iface
;
973 IHTMLTable2 IHTMLTable2_iface
;
974 IHTMLTable3 IHTMLTable3_iface
;
976 nsIDOMHTMLTableElement
*nstable
;
979 static inline HTMLTable
*impl_from_IHTMLTable(IHTMLTable
*iface
)
981 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable_iface
);
984 static inline HTMLTable
*impl_from_IHTMLTable2(IHTMLTable2
*iface
)
986 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable2_iface
);
989 static inline HTMLTable
*impl_from_IHTMLTable3(IHTMLTable3
*iface
)
991 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable3_iface
);
994 static HRESULT
var2str(const VARIANT
*p
, nsAString
*nsstr
)
1002 return nsAString_Init(nsstr
, V_BSTR(p
))?
1003 S_OK
: E_OUTOFMEMORY
;
1005 hres
= VarBstrFromR8(V_R8(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1008 hres
= VarBstrFromR4(V_R4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1011 hres
= VarBstrFromI4(V_I4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1014 FIXME("unsupported arg %s\n", debugstr_variant(p
));
1020 ret
= nsAString_Init(nsstr
, str
);
1022 return ret
? S_OK
: E_OUTOFMEMORY
;
1025 static HRESULT WINAPI
HTMLTable_QueryInterface(IHTMLTable
*iface
,
1026 REFIID riid
, void **ppv
)
1028 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1030 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1033 static ULONG WINAPI
HTMLTable_AddRef(IHTMLTable
*iface
)
1035 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1037 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1040 static ULONG WINAPI
HTMLTable_Release(IHTMLTable
*iface
)
1042 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1044 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1047 static HRESULT WINAPI
HTMLTable_GetTypeInfoCount(IHTMLTable
*iface
, UINT
*pctinfo
)
1049 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1050 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1053 static HRESULT WINAPI
HTMLTable_GetTypeInfo(IHTMLTable
*iface
, UINT iTInfo
,
1054 LCID lcid
, ITypeInfo
**ppTInfo
)
1056 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1057 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1061 static HRESULT WINAPI
HTMLTable_GetIDsOfNames(IHTMLTable
*iface
, REFIID riid
,
1062 LPOLESTR
*rgszNames
, UINT cNames
,
1063 LCID lcid
, DISPID
*rgDispId
)
1065 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1066 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1067 cNames
, lcid
, rgDispId
);
1070 static HRESULT WINAPI
HTMLTable_Invoke(IHTMLTable
*iface
, DISPID dispIdMember
,
1071 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1072 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1074 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1075 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1076 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1079 static HRESULT WINAPI
HTMLTable_put_cols(IHTMLTable
*iface
, LONG v
)
1081 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1082 FIXME("(%p)->(%ld)\n", This
, v
);
1086 static HRESULT WINAPI
HTMLTable_get_cols(IHTMLTable
*iface
, LONG
*p
)
1088 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1089 FIXME("(%p)->(%p)\n", This
, p
);
1093 static HRESULT WINAPI
HTMLTable_put_border(IHTMLTable
*iface
, VARIANT v
)
1095 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1096 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1100 static HRESULT WINAPI
HTMLTable_get_border(IHTMLTable
*iface
, VARIANT
*p
)
1102 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1103 FIXME("(%p)->(%p)\n", This
, p
);
1107 static HRESULT WINAPI
HTMLTable_put_frame(IHTMLTable
*iface
, BSTR v
)
1109 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1113 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1115 nsAString_InitDepend(&str
, v
);
1116 nsres
= nsIDOMHTMLTableElement_SetFrame(This
->nstable
, &str
);
1117 nsAString_Finish(&str
);
1119 if (NS_FAILED(nsres
)) {
1120 ERR("SetFrame(%s) failed: %08lx\n", debugstr_w(v
), nsres
);
1126 static HRESULT WINAPI
HTMLTable_get_frame(IHTMLTable
*iface
, BSTR
*p
)
1128 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1132 TRACE("(%p)->(%p)\n", This
, p
);
1134 nsAString_Init(&str
, NULL
);
1135 nsres
= nsIDOMHTMLTableElement_GetFrame(This
->nstable
, &str
);
1137 return return_nsstr(nsres
, &str
, p
);
1140 static HRESULT WINAPI
HTMLTable_put_rules(IHTMLTable
*iface
, BSTR v
)
1142 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1143 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1147 static HRESULT WINAPI
HTMLTable_get_rules(IHTMLTable
*iface
, BSTR
*p
)
1149 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1150 FIXME("(%p)->(%p)\n", This
, p
);
1154 static HRESULT WINAPI
HTMLTable_put_cellSpacing(IHTMLTable
*iface
, VARIANT v
)
1156 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1161 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1165 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
1168 swprintf(buf
, ARRAY_SIZE(buf
), L
"%d", V_I4(&v
));
1169 nsAString_InitDepend(&nsstr
, buf
);
1173 FIXME("unsupported arg %s\n", debugstr_variant(&v
));
1177 nsres
= nsIDOMHTMLTableElement_SetCellSpacing(This
->nstable
, &nsstr
);
1178 nsAString_Finish(&nsstr
);
1179 if(NS_FAILED(nsres
)) {
1180 ERR("SetCellSpacing failed: %08lx\n", nsres
);
1187 static HRESULT WINAPI
HTMLTable_get_cellSpacing(IHTMLTable
*iface
, VARIANT
*p
)
1189 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1193 TRACE("(%p)->(%p)\n", This
, p
);
1195 nsAString_Init(&nsstr
, NULL
);
1196 nsres
= nsIDOMHTMLTableElement_GetCellSpacing(This
->nstable
, &nsstr
);
1198 return return_nsstr(nsres
, &nsstr
, &V_BSTR(p
));
1201 static HRESULT WINAPI
HTMLTable_put_cellPadding(IHTMLTable
*iface
, VARIANT v
)
1203 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1208 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1210 hres
= var2str(&v
, &val
);
1214 nsres
= nsIDOMHTMLTableElement_SetCellPadding(This
->nstable
, &val
);
1215 nsAString_Finish(&val
);
1216 if(NS_FAILED(nsres
)) {
1217 ERR("Set Width(%s) failed, err = %08lx\n", debugstr_variant(&v
), nsres
);
1224 static HRESULT WINAPI
HTMLTable_get_cellPadding(IHTMLTable
*iface
, VARIANT
*p
)
1226 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1230 TRACE("(%p)->(%p)\n", This
, p
);
1232 nsAString_Init(&val
, NULL
);
1233 nsres
= nsIDOMHTMLTableElement_GetCellPadding(This
->nstable
, &val
);
1234 return return_nsstr_variant(nsres
, &val
, 0, p
);
1237 static HRESULT WINAPI
HTMLTable_put_background(IHTMLTable
*iface
, BSTR v
)
1239 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1240 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1244 static HRESULT WINAPI
HTMLTable_get_background(IHTMLTable
*iface
, BSTR
*p
)
1246 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1247 FIXME("(%p)->(%p)\n", This
, p
);
1251 static HRESULT WINAPI
HTMLTable_put_bgColor(IHTMLTable
*iface
, VARIANT v
)
1253 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1257 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1259 if(!variant_to_nscolor(&v
, &val
))
1262 nsres
= nsIDOMHTMLTableElement_SetBgColor(This
->nstable
, &val
);
1263 nsAString_Finish(&val
);
1264 if (NS_FAILED(nsres
)){
1265 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
1272 static HRESULT WINAPI
HTMLTable_get_bgColor(IHTMLTable
*iface
, VARIANT
*p
)
1274 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1278 const PRUnichar
*color
;
1280 TRACE("(%p)->(%p)\n", This
, p
);
1282 nsAString_Init(&strColor
, NULL
);
1283 nsres
= nsIDOMHTMLTableElement_GetBgColor(This
->nstable
, &strColor
);
1285 if(NS_SUCCEEDED(nsres
)) {
1286 nsAString_GetData(&strColor
, &color
);
1288 hres
= nscolor_to_str(color
, &V_BSTR(p
));
1290 ERR("SetBgColor failed: %08lx\n", nsres
);
1294 nsAString_Finish(&strColor
);
1298 static HRESULT WINAPI
HTMLTable_put_borderColor(IHTMLTable
*iface
, VARIANT v
)
1300 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1301 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1305 static HRESULT WINAPI
HTMLTable_get_borderColor(IHTMLTable
*iface
, VARIANT
*p
)
1307 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1308 FIXME("(%p)->(%p)\n", This
, p
);
1312 static HRESULT WINAPI
HTMLTable_put_borderColorLight(IHTMLTable
*iface
, VARIANT v
)
1314 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1315 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1319 static HRESULT WINAPI
HTMLTable_get_borderColorLight(IHTMLTable
*iface
, VARIANT
*p
)
1321 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1322 FIXME("(%p)->(%p)\n", This
, p
);
1326 static HRESULT WINAPI
HTMLTable_put_borderColorDark(IHTMLTable
*iface
, VARIANT v
)
1328 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1329 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1333 static HRESULT WINAPI
HTMLTable_get_borderColorDark(IHTMLTable
*iface
, VARIANT
*p
)
1335 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1336 FIXME("(%p)->(%p)\n", This
, p
);
1340 static HRESULT WINAPI
HTMLTable_put_align(IHTMLTable
*iface
, BSTR v
)
1342 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1346 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1348 nsAString_InitDepend(&val
, v
);
1350 nsres
= nsIDOMHTMLTableElement_SetAlign(This
->nstable
, &val
);
1351 nsAString_Finish(&val
);
1352 if (NS_FAILED(nsres
)){
1353 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
1359 static HRESULT WINAPI
HTMLTable_get_align(IHTMLTable
*iface
, BSTR
*p
)
1361 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1365 TRACE("(%p)->(%p)\n", This
, p
);
1367 nsAString_Init(&val
, NULL
);
1368 nsres
= nsIDOMHTMLTableElement_GetAlign(This
->nstable
, &val
);
1370 return return_nsstr(nsres
, &val
, p
);
1373 static HRESULT WINAPI
HTMLTable_refresh(IHTMLTable
*iface
)
1375 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1376 FIXME("(%p)\n", This
);
1380 static HRESULT WINAPI
HTMLTable_get_rows(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1382 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1383 nsIDOMHTMLCollection
*nscol
;
1386 TRACE("(%p)->(%p)\n", This
, p
);
1388 nsres
= nsIDOMHTMLTableElement_GetRows(This
->nstable
, &nscol
);
1389 if(NS_FAILED(nsres
)) {
1390 ERR("GetRows failed: %08lx\n", nsres
);
1394 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1396 nsIDOMHTMLCollection_Release(nscol
);
1400 static HRESULT WINAPI
HTMLTable_put_width(IHTMLTable
*iface
, VARIANT v
)
1402 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1407 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1408 hres
= var2str(&v
, &val
);
1411 ERR("Set Width(%s) failed when initializing a nsAString, err = %08lx\n",
1412 debugstr_variant(&v
), hres
);
1416 nsres
= nsIDOMHTMLTableElement_SetWidth(This
->nstable
, &val
);
1417 nsAString_Finish(&val
);
1419 if (NS_FAILED(nsres
)){
1420 ERR("Set Width(%s) failed, err = %08lx\n", debugstr_variant(&v
), nsres
);
1426 static HRESULT WINAPI
HTMLTable_get_width(IHTMLTable
*iface
, VARIANT
*p
)
1428 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1432 TRACE("(%p)->(%p)\n", This
, p
);
1434 nsAString_Init(&val
, NULL
);
1435 nsres
= nsIDOMHTMLTableElement_GetWidth(This
->nstable
, &val
);
1436 return return_nsstr_variant(nsres
, &val
, NSSTR_IMPLICIT_PX
, p
);
1439 static HRESULT WINAPI
HTMLTable_put_height(IHTMLTable
*iface
, VARIANT v
)
1441 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1442 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1446 static HRESULT WINAPI
HTMLTable_get_height(IHTMLTable
*iface
, VARIANT
*p
)
1448 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1449 FIXME("(%p)->(%p)\n", This
, p
);
1453 static HRESULT WINAPI
HTMLTable_put_dataPageSize(IHTMLTable
*iface
, LONG v
)
1455 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1456 FIXME("(%p)->(%ld)\n", This
, v
);
1460 static HRESULT WINAPI
HTMLTable_get_dataPageSize(IHTMLTable
*iface
, LONG
*p
)
1462 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1463 FIXME("(%p)->(%p)\n", This
, p
);
1467 static HRESULT WINAPI
HTMLTable_nextPage(IHTMLTable
*iface
)
1469 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1470 FIXME("(%p)\n", This
);
1474 static HRESULT WINAPI
HTMLTable_previousPage(IHTMLTable
*iface
)
1476 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1477 FIXME("(%p)\n", This
);
1481 static HRESULT WINAPI
HTMLTable_get_tHead(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1483 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1484 FIXME("(%p)->(%p)\n", This
, p
);
1488 static HRESULT WINAPI
HTMLTable_get_tFoot(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1490 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1491 FIXME("(%p)->(%p)\n", This
, p
);
1495 static HRESULT WINAPI
HTMLTable_get_tBodies(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1497 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1498 nsIDOMHTMLCollection
*nscol
= NULL
;
1501 TRACE("(%p)->(%p)\n", This
, p
);
1503 nsres
= nsIDOMHTMLTableElement_GetTBodies(This
->nstable
, &nscol
);
1504 if(NS_FAILED(nsres
)) {
1505 ERR("GetTBodies failed: %08lx\n", nsres
);
1509 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1511 nsIDOMHTMLCollection_Release(nscol
);
1515 static HRESULT WINAPI
HTMLTable_get_caption(IHTMLTable
*iface
, IHTMLTableCaption
**p
)
1517 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1518 FIXME("(%p)->(%p)\n", This
, p
);
1522 static HRESULT WINAPI
HTMLTable_createTHead(IHTMLTable
*iface
, IDispatch
**head
)
1524 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1525 FIXME("(%p)->(%p)\n", This
, head
);
1529 static HRESULT WINAPI
HTMLTable_deleteTHead(IHTMLTable
*iface
)
1531 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1532 FIXME("(%p)\n", This
);
1536 static HRESULT WINAPI
HTMLTable_createTFoot(IHTMLTable
*iface
, IDispatch
**foot
)
1538 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1539 FIXME("(%p)->(%p)\n", This
, foot
);
1543 static HRESULT WINAPI
HTMLTable_deleteTFoot(IHTMLTable
*iface
)
1545 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1546 FIXME("(%p)\n", This
);
1550 static HRESULT WINAPI
HTMLTable_createCaption(IHTMLTable
*iface
, IHTMLTableCaption
**caption
)
1552 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1553 FIXME("(%p)->(%p)\n", This
, caption
);
1557 static HRESULT WINAPI
HTMLTable_deleteCaption(IHTMLTable
*iface
)
1559 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1560 FIXME("(%p)\n", This
);
1564 static HRESULT WINAPI
HTMLTable_insertRow(IHTMLTable
*iface
, LONG index
, IDispatch
**row
)
1566 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1567 nsIDOMHTMLElement
*nselem
;
1572 TRACE("(%p)->(%ld %p)\n", This
, index
, row
);
1573 nsres
= nsIDOMHTMLTableElement_InsertRow(This
->nstable
, index
, &nselem
);
1574 if(NS_FAILED(nsres
)) {
1575 ERR("Insert Row at %ld failed: %08lx\n", index
, nsres
);
1579 hres
= HTMLTableRow_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
1580 nsIDOMHTMLElement_Release(nselem
);
1582 ERR("Create TableRow failed: %08lx\n", hres
);
1586 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
1590 static HRESULT WINAPI
HTMLTable_deleteRow(IHTMLTable
*iface
, LONG index
)
1592 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1595 TRACE("(%p)->(%ld)\n", This
, index
);
1596 nsres
= nsIDOMHTMLTableElement_DeleteRow(This
->nstable
, index
);
1597 if(NS_FAILED(nsres
)) {
1598 ERR("Delete Row failed: %08lx\n", nsres
);
1604 static HRESULT WINAPI
HTMLTable_get_readyState(IHTMLTable
*iface
, BSTR
*p
)
1606 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1607 FIXME("(%p)->(%p)\n", This
, p
);
1611 static HRESULT WINAPI
HTMLTable_put_onreadystatechange(IHTMLTable
*iface
, VARIANT v
)
1613 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1614 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1618 static HRESULT WINAPI
HTMLTable_get_onreadystatechange(IHTMLTable
*iface
, VARIANT
*p
)
1620 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1621 FIXME("(%p)->(%p)\n", This
, p
);
1625 static const IHTMLTableVtbl HTMLTableVtbl
= {
1626 HTMLTable_QueryInterface
,
1629 HTMLTable_GetTypeInfoCount
,
1630 HTMLTable_GetTypeInfo
,
1631 HTMLTable_GetIDsOfNames
,
1635 HTMLTable_put_border
,
1636 HTMLTable_get_border
,
1637 HTMLTable_put_frame
,
1638 HTMLTable_get_frame
,
1639 HTMLTable_put_rules
,
1640 HTMLTable_get_rules
,
1641 HTMLTable_put_cellSpacing
,
1642 HTMLTable_get_cellSpacing
,
1643 HTMLTable_put_cellPadding
,
1644 HTMLTable_get_cellPadding
,
1645 HTMLTable_put_background
,
1646 HTMLTable_get_background
,
1647 HTMLTable_put_bgColor
,
1648 HTMLTable_get_bgColor
,
1649 HTMLTable_put_borderColor
,
1650 HTMLTable_get_borderColor
,
1651 HTMLTable_put_borderColorLight
,
1652 HTMLTable_get_borderColorLight
,
1653 HTMLTable_put_borderColorDark
,
1654 HTMLTable_get_borderColorDark
,
1655 HTMLTable_put_align
,
1656 HTMLTable_get_align
,
1659 HTMLTable_put_width
,
1660 HTMLTable_get_width
,
1661 HTMLTable_put_height
,
1662 HTMLTable_get_height
,
1663 HTMLTable_put_dataPageSize
,
1664 HTMLTable_get_dataPageSize
,
1666 HTMLTable_previousPage
,
1667 HTMLTable_get_tHead
,
1668 HTMLTable_get_tFoot
,
1669 HTMLTable_get_tBodies
,
1670 HTMLTable_get_caption
,
1671 HTMLTable_createTHead
,
1672 HTMLTable_deleteTHead
,
1673 HTMLTable_createTFoot
,
1674 HTMLTable_deleteTFoot
,
1675 HTMLTable_createCaption
,
1676 HTMLTable_deleteCaption
,
1677 HTMLTable_insertRow
,
1678 HTMLTable_deleteRow
,
1679 HTMLTable_get_readyState
,
1680 HTMLTable_put_onreadystatechange
,
1681 HTMLTable_get_onreadystatechange
1685 static HRESULT WINAPI
HTMLTable2_QueryInterface(IHTMLTable2
*iface
,
1686 REFIID riid
, void **ppv
)
1688 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1690 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1693 static ULONG WINAPI
HTMLTable2_AddRef(IHTMLTable2
*iface
)
1695 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1697 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1700 static ULONG WINAPI
HTMLTable2_Release(IHTMLTable2
*iface
)
1702 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1704 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1707 static HRESULT WINAPI
HTMLTable2_GetTypeInfoCount(IHTMLTable2
*iface
, UINT
*pctinfo
)
1709 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1710 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1713 static HRESULT WINAPI
HTMLTable2_GetTypeInfo(IHTMLTable2
*iface
, UINT iTInfo
,
1714 LCID lcid
, ITypeInfo
**ppTInfo
)
1716 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1717 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1721 static HRESULT WINAPI
HTMLTable2_GetIDsOfNames(IHTMLTable2
*iface
, REFIID riid
,
1722 LPOLESTR
*rgszNames
, UINT cNames
,
1723 LCID lcid
, DISPID
*rgDispId
)
1725 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1726 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1727 cNames
, lcid
, rgDispId
);
1730 static HRESULT WINAPI
HTMLTable2_Invoke(IHTMLTable2
*iface
, DISPID dispIdMember
,
1731 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1732 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1734 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1735 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1736 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1739 static HRESULT WINAPI
HTMLTable2_firstPage(IHTMLTable2
*iface
)
1741 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1742 FIXME("(%p)->()\n", This
);
1746 static HRESULT WINAPI
HTMLTable2_lastPage(IHTMLTable2
*iface
)
1748 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1749 FIXME("(%p)->()\n", This
);
1753 static HRESULT WINAPI
HTMLTable2_cells(IHTMLTable2
*iface
, IHTMLElementCollection
**p
)
1755 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1756 FIXME("(%p)->(%p)\n", This
, p
);
1760 static HRESULT WINAPI
HTMLTable2_moveRow(IHTMLTable2
*iface
, LONG indexFrom
, LONG indexTo
, IDispatch
**row
)
1762 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1763 FIXME("(%p)->(%ld %ld %p)\n", This
, indexFrom
, indexTo
, row
);
1768 static const IHTMLTable2Vtbl HTMLTable2Vtbl
= {
1769 HTMLTable2_QueryInterface
,
1772 HTMLTable2_GetTypeInfoCount
,
1773 HTMLTable2_GetTypeInfo
,
1774 HTMLTable2_GetIDsOfNames
,
1776 HTMLTable2_firstPage
,
1777 HTMLTable2_lastPage
,
1783 static HRESULT WINAPI
HTMLTable3_QueryInterface(IHTMLTable3
*iface
,
1784 REFIID riid
, void **ppv
)
1786 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1788 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1791 static ULONG WINAPI
HTMLTable3_AddRef(IHTMLTable3
*iface
)
1793 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1795 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1798 static ULONG WINAPI
HTMLTable3_Release(IHTMLTable3
*iface
)
1800 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1802 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1805 static HRESULT WINAPI
HTMLTable3_GetTypeInfoCount(IHTMLTable3
*iface
, UINT
*pctinfo
)
1807 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1808 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1811 static HRESULT WINAPI
HTMLTable3_GetTypeInfo(IHTMLTable3
*iface
, UINT iTInfo
,
1812 LCID lcid
, ITypeInfo
**ppTInfo
)
1814 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1815 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1819 static HRESULT WINAPI
HTMLTable3_GetIDsOfNames(IHTMLTable3
*iface
, REFIID riid
,
1820 LPOLESTR
*rgszNames
, UINT cNames
,
1821 LCID lcid
, DISPID
*rgDispId
)
1823 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1824 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1825 cNames
, lcid
, rgDispId
);
1828 static HRESULT WINAPI
HTMLTable3_Invoke(IHTMLTable3
*iface
, DISPID dispIdMember
,
1829 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1830 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1832 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1833 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1834 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1837 static HRESULT WINAPI
HTMLTable3_put_summary(IHTMLTable3
*iface
, BSTR v
)
1839 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1843 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1845 nsAString_InitDepend(&str
, v
);
1847 nsres
= nsIDOMHTMLTableElement_SetSummary(This
->nstable
, &str
);
1849 nsAString_Finish(&str
);
1850 if (NS_FAILED(nsres
)) {
1851 ERR("Set summary(%s) failed: %08lx\n", debugstr_w(v
), nsres
);
1857 static HRESULT WINAPI
HTMLTable3_get_summary(IHTMLTable3
*iface
, BSTR
* p
)
1859 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1863 TRACE("(%p)->(%p)\n", This
, p
);
1865 nsAString_Init(&str
, NULL
);
1866 nsres
= nsIDOMHTMLTableElement_GetSummary(This
->nstable
, &str
);
1868 return return_nsstr(nsres
, &str
, p
);
1871 static const IHTMLTable3Vtbl HTMLTable3Vtbl
= {
1872 HTMLTable3_QueryInterface
,
1875 HTMLTable3_GetTypeInfoCount
,
1876 HTMLTable3_GetTypeInfo
,
1877 HTMLTable3_GetIDsOfNames
,
1879 HTMLTable3_put_summary
,
1880 HTMLTable3_get_summary
1883 static inline HTMLTable
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1885 return CONTAINING_RECORD(iface
, HTMLTable
, element
.node
);
1888 static HRESULT
HTMLTable_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1890 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1894 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1895 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1896 *ppv
= &This
->IHTMLTable_iface
;
1897 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1898 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1899 *ppv
= &This
->IHTMLTable_iface
;
1900 }else if(IsEqualGUID(&IID_IHTMLTable
, riid
)) {
1901 TRACE("(%p)->(IID_IHTMLTable %p)\n", This
, ppv
);
1902 *ppv
= &This
->IHTMLTable_iface
;
1903 }else if(IsEqualGUID(&IID_IHTMLTable2
, riid
)) {
1904 TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This
, ppv
);
1905 *ppv
= &This
->IHTMLTable2_iface
;
1906 }else if(IsEqualGUID(&IID_IHTMLTable3
, riid
)) {
1907 TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This
, ppv
);
1908 *ppv
= &This
->IHTMLTable3_iface
;
1912 IUnknown_AddRef((IUnknown
*)*ppv
);
1916 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1919 static void HTMLTable_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
1921 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1924 note_cc_edge((nsISupports
*)This
->nstable
, "This->nstable", cb
);
1927 static void HTMLTable_unlink(HTMLDOMNode
*iface
)
1929 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1930 unlink_ref(&This
->nstable
);
1933 static const cpc_entry_t HTMLTable_cpc
[] = {
1934 {&DIID_HTMLTableEvents
},
1939 static const NodeImplVtbl HTMLTableImplVtbl
= {
1940 .clsid
= &CLSID_HTMLTable
,
1942 .destructor
= HTMLElement_destructor
,
1943 .cpc_entries
= HTMLTable_cpc
,
1944 .clone
= HTMLElement_clone
,
1945 .handle_event
= HTMLElement_handle_event
,
1946 .get_attr_col
= HTMLElement_get_attr_col
,
1947 .traverse
= HTMLTable_traverse
,
1948 .unlink
= HTMLTable_unlink
1951 static const tid_t HTMLTable_iface_tids
[] = {
1959 static dispex_static_data_t HTMLTable_dispex
= {
1961 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
1963 HTMLTable_iface_tids
,
1964 HTMLElement_init_dispex_info
1967 HRESULT
HTMLTable_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1972 ret
= calloc(1, sizeof(HTMLTable
));
1974 return E_OUTOFMEMORY
;
1976 ret
->element
.node
.vtbl
= &HTMLTableImplVtbl
;
1977 ret
->IHTMLTable_iface
.lpVtbl
= &HTMLTableVtbl
;
1978 ret
->IHTMLTable2_iface
.lpVtbl
= &HTMLTable2Vtbl
;
1979 ret
->IHTMLTable3_iface
.lpVtbl
= &HTMLTable3Vtbl
;
1981 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTable_dispex
);
1983 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableElement
, (void**)&ret
->nstable
);
1984 assert(nsres
== NS_OK
);
1986 *elem
= &ret
->element
;