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"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
34 struct HTMLTableCell
{
37 IHTMLTableCell IHTMLTableCell_iface
;
39 nsIDOMHTMLTableCellElement
*nscell
;
42 static inline HTMLTableCell
*impl_from_IHTMLTableCell(IHTMLTableCell
*iface
)
44 return CONTAINING_RECORD(iface
, HTMLTableCell
, IHTMLTableCell_iface
);
47 static HRESULT WINAPI
HTMLTableCell_QueryInterface(IHTMLTableCell
*iface
, REFIID riid
, void **ppv
)
49 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
51 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
54 static ULONG WINAPI
HTMLTableCell_AddRef(IHTMLTableCell
*iface
)
56 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
58 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
61 static ULONG WINAPI
HTMLTableCell_Release(IHTMLTableCell
*iface
)
63 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
65 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
68 static HRESULT WINAPI
HTMLTableCell_GetTypeInfoCount(IHTMLTableCell
*iface
, UINT
*pctinfo
)
70 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
71 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
74 static HRESULT WINAPI
HTMLTableCell_GetTypeInfo(IHTMLTableCell
*iface
, UINT iTInfo
,
75 LCID lcid
, ITypeInfo
**ppTInfo
)
77 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
78 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
82 static HRESULT WINAPI
HTMLTableCell_GetIDsOfNames(IHTMLTableCell
*iface
, REFIID riid
,
83 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
85 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
86 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
87 cNames
, lcid
, rgDispId
);
90 static HRESULT WINAPI
HTMLTableCell_Invoke(IHTMLTableCell
*iface
, DISPID dispIdMember
, REFIID riid
,
91 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
94 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
95 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
96 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
99 static HRESULT WINAPI
HTMLTableCell_put_rowSpan(IHTMLTableCell
*iface
, LONG v
)
101 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
104 TRACE("(%p)->(%ld)\n", This
, v
);
109 nsres
= nsIDOMHTMLTableCellElement_SetRowSpan(This
->nscell
, v
);
110 if(NS_FAILED(nsres
)) {
111 ERR("SetRowSpan failed: %08lx\n", nsres
);
118 static HRESULT WINAPI
HTMLTableCell_get_rowSpan(IHTMLTableCell
*iface
, LONG
*p
)
120 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
123 TRACE("(%p)->(%p)\n", This
, p
);
125 nsres
= nsIDOMHTMLTableCellElement_GetRowSpan(This
->nscell
, p
);
126 if(NS_FAILED(nsres
)) {
127 ERR("GetRowSpan failed: %08lx\n", nsres
);
134 static HRESULT WINAPI
HTMLTableCell_put_colSpan(IHTMLTableCell
*iface
, LONG v
)
136 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
139 TRACE("(%p)->(%ld)\n", This
, v
);
144 nsres
= nsIDOMHTMLTableCellElement_SetColSpan(This
->nscell
, v
);
145 if(NS_FAILED(nsres
)) {
146 ERR("SetColSpan failed: %08lx\n", nsres
);
153 static HRESULT WINAPI
HTMLTableCell_get_colSpan(IHTMLTableCell
*iface
, LONG
*p
)
155 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
158 TRACE("(%p)->(%p)\n", This
, p
);
160 nsres
= nsIDOMHTMLTableCellElement_GetColSpan(This
->nscell
, p
);
161 if(NS_FAILED(nsres
)) {
162 ERR("GetColSpan failed: %08lx\n", nsres
);
169 static HRESULT WINAPI
HTMLTableCell_put_align(IHTMLTableCell
*iface
, BSTR v
)
171 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
175 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
177 nsAString_InitDepend(&str
, v
);
178 nsres
= nsIDOMHTMLTableCellElement_SetAlign(This
->nscell
, &str
);
179 nsAString_Finish(&str
);
180 if (NS_FAILED(nsres
)) {
181 ERR("Set Align failed: %08lx\n", nsres
);
187 static HRESULT WINAPI
HTMLTableCell_get_align(IHTMLTableCell
*iface
, BSTR
*p
)
189 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
193 TRACE("(%p)->(%p)\n", This
, p
);
195 nsAString_Init(&str
, NULL
);
196 nsres
= nsIDOMHTMLTableCellElement_GetAlign(This
->nscell
, &str
);
198 return return_nsstr(nsres
, &str
, p
);
201 static HRESULT WINAPI
HTMLTableCell_put_vAlign(IHTMLTableCell
*iface
, BSTR v
)
203 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
204 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
208 static HRESULT WINAPI
HTMLTableCell_get_vAlign(IHTMLTableCell
*iface
, BSTR
*p
)
210 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
211 FIXME("(%p)->(%p)\n", This
, p
);
215 static HRESULT WINAPI
HTMLTableCell_put_bgColor(IHTMLTableCell
*iface
, VARIANT v
)
217 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
221 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
223 if(!variant_to_nscolor(&v
, &strColor
))
226 nsres
= nsIDOMHTMLTableCellElement_SetBgColor(This
->nscell
, &strColor
);
227 nsAString_Finish(&strColor
);
228 if(NS_FAILED(nsres
)) {
229 ERR("SetBgColor(%s) failed: %08lx\n", debugstr_variant(&v
), nsres
);
236 static HRESULT WINAPI
HTMLTableCell_get_bgColor(IHTMLTableCell
*iface
, VARIANT
*p
)
238 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
243 TRACE("(%p)->(%p)\n", This
, p
);
245 nsAString_Init(&strColor
, NULL
);
246 nsres
= nsIDOMHTMLTableCellElement_GetBgColor(This
->nscell
, &strColor
);
248 if(NS_SUCCEEDED(nsres
)) {
249 const PRUnichar
*color
;
250 nsAString_GetData(&strColor
, &color
);
252 hres
= nscolor_to_str(color
, &V_BSTR(p
));
254 ERR("GetBgColor failed: %08lx\n", nsres
);
257 nsAString_Finish(&strColor
);
261 static HRESULT WINAPI
HTMLTableCell_put_noWrap(IHTMLTableCell
*iface
, VARIANT_BOOL v
)
263 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
264 FIXME("(%p)->(%x)\n", This
, v
);
268 static HRESULT WINAPI
HTMLTableCell_get_noWrap(IHTMLTableCell
*iface
, VARIANT_BOOL
*p
)
270 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
271 FIXME("(%p)->(%p)\n", This
, p
);
275 static HRESULT WINAPI
HTMLTableCell_put_background(IHTMLTableCell
*iface
, BSTR v
)
277 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
278 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
282 static HRESULT WINAPI
HTMLTableCell_get_background(IHTMLTableCell
*iface
, BSTR
*p
)
284 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
285 FIXME("(%p)->(%p)\n", This
, p
);
289 static HRESULT WINAPI
HTMLTableCell_put_borderColor(IHTMLTableCell
*iface
, VARIANT v
)
291 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
292 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
296 static HRESULT WINAPI
HTMLTableCell_get_borderColor(IHTMLTableCell
*iface
, VARIANT
*p
)
298 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
299 FIXME("(%p)->(%p)\n", This
, p
);
303 static HRESULT WINAPI
HTMLTableCell_put_borderColorLight(IHTMLTableCell
*iface
, VARIANT v
)
305 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
306 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
310 static HRESULT WINAPI
HTMLTableCell_get_borderColorLight(IHTMLTableCell
*iface
, VARIANT
*p
)
312 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
313 FIXME("(%p)->(%p)\n", This
, p
);
317 static HRESULT WINAPI
HTMLTableCell_put_borderColorDark(IHTMLTableCell
*iface
, VARIANT v
)
319 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
320 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
324 static HRESULT WINAPI
HTMLTableCell_get_borderColorDark(IHTMLTableCell
*iface
, VARIANT
*p
)
326 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
327 FIXME("(%p)->(%p)\n", This
, p
);
331 static HRESULT WINAPI
HTMLTableCell_put_width(IHTMLTableCell
*iface
, VARIANT v
)
333 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
338 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
340 hres
= variant_to_nsstr(&v
, FALSE
, &nsstr
);
344 nsres
= nsIDOMHTMLTableCellElement_SetWidth(This
->nscell
, &nsstr
);
345 nsAString_Finish(&nsstr
);
346 return map_nsresult(nsres
);
349 static HRESULT WINAPI
HTMLTableCell_get_width(IHTMLTableCell
*iface
, VARIANT
*p
)
351 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
355 TRACE("(%p)->(%p)\n", This
, p
);
357 nsAString_Init(&nsstr
, NULL
);
358 nsres
= nsIDOMHTMLTableCellElement_GetWidth(This
->nscell
, &nsstr
);
359 return return_nsstr_variant(nsres
, &nsstr
, NSSTR_IMPLICIT_PX
, p
);
362 static HRESULT WINAPI
HTMLTableCell_put_height(IHTMLTableCell
*iface
, VARIANT v
)
364 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
369 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
371 hres
= variant_to_nsstr(&v
, FALSE
, &nsstr
);
375 nsres
= nsIDOMHTMLTableCellElement_SetHeight(This
->nscell
, &nsstr
);
376 nsAString_Finish(&nsstr
);
377 return map_nsresult(nsres
);
380 static HRESULT WINAPI
HTMLTableCell_get_height(IHTMLTableCell
*iface
, VARIANT
*p
)
382 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
386 TRACE("(%p)->(%p)\n", This
, p
);
388 nsAString_Init(&nsstr
, NULL
);
389 nsres
= nsIDOMHTMLTableCellElement_GetHeight(This
->nscell
, &nsstr
);
390 return return_nsstr_variant(nsres
, &nsstr
, NSSTR_IMPLICIT_PX
, p
);
393 static HRESULT WINAPI
HTMLTableCell_get_cellIndex(IHTMLTableCell
*iface
, LONG
*p
)
395 HTMLTableCell
*This
= impl_from_IHTMLTableCell(iface
);
398 TRACE("(%p)->(%p)\n", This
, p
);
399 nsres
= nsIDOMHTMLTableCellElement_GetCellIndex(This
->nscell
, p
);
400 if (NS_FAILED(nsres
)) {
401 ERR("Get CellIndex failed: %08lx\n", nsres
);
408 static const IHTMLTableCellVtbl HTMLTableCellVtbl
= {
409 HTMLTableCell_QueryInterface
,
410 HTMLTableCell_AddRef
,
411 HTMLTableCell_Release
,
412 HTMLTableCell_GetTypeInfoCount
,
413 HTMLTableCell_GetTypeInfo
,
414 HTMLTableCell_GetIDsOfNames
,
415 HTMLTableCell_Invoke
,
416 HTMLTableCell_put_rowSpan
,
417 HTMLTableCell_get_rowSpan
,
418 HTMLTableCell_put_colSpan
,
419 HTMLTableCell_get_colSpan
,
420 HTMLTableCell_put_align
,
421 HTMLTableCell_get_align
,
422 HTMLTableCell_put_vAlign
,
423 HTMLTableCell_get_vAlign
,
424 HTMLTableCell_put_bgColor
,
425 HTMLTableCell_get_bgColor
,
426 HTMLTableCell_put_noWrap
,
427 HTMLTableCell_get_noWrap
,
428 HTMLTableCell_put_background
,
429 HTMLTableCell_get_background
,
430 HTMLTableCell_put_borderColor
,
431 HTMLTableCell_get_borderColor
,
432 HTMLTableCell_put_borderColorLight
,
433 HTMLTableCell_get_borderColorLight
,
434 HTMLTableCell_put_borderColorDark
,
435 HTMLTableCell_get_borderColorDark
,
436 HTMLTableCell_put_width
,
437 HTMLTableCell_get_width
,
438 HTMLTableCell_put_height
,
439 HTMLTableCell_get_height
,
440 HTMLTableCell_get_cellIndex
443 static inline HTMLTableCell
*HTMLTableCell_from_HTMLDOMNode(HTMLDOMNode
*iface
)
445 return CONTAINING_RECORD(iface
, HTMLTableCell
, element
.node
);
448 static HRESULT
HTMLTableCell_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
450 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
452 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
453 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
454 *ppv
= &This
->IHTMLTableCell_iface
;
455 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
456 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
457 *ppv
= &This
->IHTMLTableCell_iface
;
458 }else if(IsEqualGUID(&IID_IHTMLTableCell
, riid
)) {
459 TRACE("(%p)->(IID_IHTMLTableCell %p)\n", This
, ppv
);
460 *ppv
= &This
->IHTMLTableCell_iface
;
462 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
465 IUnknown_AddRef((IUnknown
*)*ppv
);
469 static void HTMLTableCell_destructor(HTMLDOMNode
*iface
)
471 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
473 HTMLElement_destructor(&This
->element
.node
);
476 static void HTMLTableCell_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
478 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
481 note_cc_edge((nsISupports
*)This
->nscell
, "This->nstablecell", cb
);
484 static void HTMLTableCell_unlink(HTMLDOMNode
*iface
)
486 HTMLTableCell
*This
= HTMLTableCell_from_HTMLDOMNode(iface
);
489 nsIDOMHTMLTableCellElement
*nscell
= This
->nscell
;
492 nsIDOMHTMLTableCellElement_Release(nscell
);
496 static const NodeImplVtbl HTMLTableCellImplVtbl
= {
497 &CLSID_HTMLTableCell
,
499 HTMLTableCell_destructor
,
502 HTMLElement_dispatch_nsevent_hook
,
503 HTMLElement_handle_event
,
504 HTMLElement_get_attr_col
,
514 HTMLTableCell_traverse
,
518 static const tid_t HTMLTableCell_iface_tids
[] = {
524 static dispex_static_data_t HTMLTableCell_dispex
= {
525 L
"HTMLTableDataCellElement",
527 DispHTMLTableCell_tid
,
528 HTMLTableCell_iface_tids
,
529 HTMLElement_init_dispex_info
532 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
537 ret
= calloc(1, sizeof(*ret
));
539 return E_OUTOFMEMORY
;
541 ret
->IHTMLTableCell_iface
.lpVtbl
= &HTMLTableCellVtbl
;
542 ret
->element
.node
.vtbl
= &HTMLTableCellImplVtbl
;
544 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableCell_dispex
);
546 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableCellElement
, (void**)&ret
->nscell
);
547 assert(nsres
== NS_OK
);
549 *elem
= &ret
->element
;
553 struct HTMLTableRow
{
556 IHTMLTableRow IHTMLTableRow_iface
;
558 nsIDOMHTMLTableRowElement
*nsrow
;
561 static inline HTMLTableRow
*impl_from_IHTMLTableRow(IHTMLTableRow
*iface
)
563 return CONTAINING_RECORD(iface
, HTMLTableRow
, IHTMLTableRow_iface
);
566 static HRESULT WINAPI
HTMLTableRow_QueryInterface(IHTMLTableRow
*iface
,
567 REFIID riid
, void **ppv
)
569 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
571 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
574 static ULONG WINAPI
HTMLTableRow_AddRef(IHTMLTableRow
*iface
)
576 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
578 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
581 static ULONG WINAPI
HTMLTableRow_Release(IHTMLTableRow
*iface
)
583 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
585 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
588 static HRESULT WINAPI
HTMLTableRow_GetTypeInfoCount(IHTMLTableRow
*iface
, UINT
*pctinfo
)
590 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
591 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
594 static HRESULT WINAPI
HTMLTableRow_GetTypeInfo(IHTMLTableRow
*iface
, UINT iTInfo
,
595 LCID lcid
, ITypeInfo
**ppTInfo
)
597 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
598 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
602 static HRESULT WINAPI
HTMLTableRow_GetIDsOfNames(IHTMLTableRow
*iface
, REFIID riid
,
603 LPOLESTR
*rgszNames
, UINT cNames
,
604 LCID lcid
, DISPID
*rgDispId
)
606 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
607 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
608 cNames
, lcid
, rgDispId
);
611 static HRESULT WINAPI
HTMLTableRow_Invoke(IHTMLTableRow
*iface
, DISPID dispIdMember
,
612 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
613 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
615 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
616 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
617 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
620 static HRESULT WINAPI
HTMLTableRow_put_align(IHTMLTableRow
*iface
, BSTR v
)
622 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
626 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
628 nsAString_InitDepend(&val
, v
);
630 nsres
= nsIDOMHTMLTableRowElement_SetAlign(This
->nsrow
, &val
);
631 nsAString_Finish(&val
);
632 if (NS_FAILED(nsres
)){
633 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
639 static HRESULT WINAPI
HTMLTableRow_get_align(IHTMLTableRow
*iface
, BSTR
*p
)
641 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
645 TRACE("(%p)->(%p)\n", This
, p
);
647 nsAString_Init(&val
, NULL
);
648 nsres
= nsIDOMHTMLTableRowElement_GetAlign(This
->nsrow
, &val
);
650 return return_nsstr(nsres
, &val
, p
);
653 static HRESULT WINAPI
HTMLTableRow_put_vAlign(IHTMLTableRow
*iface
, BSTR v
)
655 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
659 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
661 nsAString_InitDepend(&val
, v
);
663 nsres
= nsIDOMHTMLTableRowElement_SetVAlign(This
->nsrow
, &val
);
664 nsAString_Finish(&val
);
666 if (NS_FAILED(nsres
)){
667 ERR("Set VAlign(%s) failed!\n", debugstr_w(v
));
674 static HRESULT WINAPI
HTMLTableRow_get_vAlign(IHTMLTableRow
*iface
, BSTR
*p
)
676 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
680 TRACE("(%p)->(%p)\n", This
, p
);
682 nsAString_Init(&val
, NULL
);
683 nsres
= nsIDOMHTMLTableRowElement_GetVAlign(This
->nsrow
, &val
);
685 return return_nsstr(nsres
, &val
, p
);
688 static HRESULT WINAPI
HTMLTableRow_put_bgColor(IHTMLTableRow
*iface
, VARIANT v
)
690 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
694 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
696 if (!variant_to_nscolor(&v
, &val
))
699 nsres
= nsIDOMHTMLTableRowElement_SetBgColor(This
->nsrow
, &val
);
700 nsAString_Finish(&val
);
702 if (NS_FAILED(nsres
)){
703 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
710 static HRESULT WINAPI
HTMLTableRow_get_bgColor(IHTMLTableRow
*iface
, VARIANT
*p
)
712 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
716 const PRUnichar
*color
;
718 TRACE("(%p)->(%p)\n", This
, p
);
720 nsAString_Init(&strColor
, NULL
);
721 nsres
= nsIDOMHTMLTableRowElement_GetBgColor(This
->nsrow
, &strColor
);
723 if(NS_SUCCEEDED(nsres
)) {
724 nsAString_GetData(&strColor
, &color
);
726 hres
= nscolor_to_str(color
, &V_BSTR(p
));
728 ERR("SetBgColor failed: %08lx\n", nsres
);
732 nsAString_Finish(&strColor
);
736 static HRESULT WINAPI
HTMLTableRow_put_borderColor(IHTMLTableRow
*iface
, VARIANT v
)
738 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
739 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
743 static HRESULT WINAPI
HTMLTableRow_get_borderColor(IHTMLTableRow
*iface
, VARIANT
*p
)
745 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
746 FIXME("(%p)->(%p)\n", This
, p
);
750 static HRESULT WINAPI
HTMLTableRow_put_borderColorLight(IHTMLTableRow
*iface
, VARIANT v
)
752 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
753 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
757 static HRESULT WINAPI
HTMLTableRow_get_borderColorLight(IHTMLTableRow
*iface
, VARIANT
*p
)
759 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
760 FIXME("(%p)->(%p)\n", This
, p
);
764 static HRESULT WINAPI
HTMLTableRow_put_borderColorDark(IHTMLTableRow
*iface
, VARIANT v
)
766 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
767 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
771 static HRESULT WINAPI
HTMLTableRow_get_borderColorDark(IHTMLTableRow
*iface
, VARIANT
*p
)
773 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
774 FIXME("(%p)->(%p)\n", This
, p
);
778 static HRESULT WINAPI
HTMLTableRow_get_rowIndex(IHTMLTableRow
*iface
, LONG
*p
)
780 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
783 TRACE("(%p)->(%p)\n", This
, p
);
784 nsres
= nsIDOMHTMLTableRowElement_GetRowIndex(This
->nsrow
, p
);
785 if(NS_FAILED(nsres
)) {
786 ERR("Get rowIndex failed: %08lx\n", nsres
);
792 static HRESULT WINAPI
HTMLTableRow_get_sectionRowIndex(IHTMLTableRow
*iface
, LONG
*p
)
794 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
797 TRACE("(%p)->(%p)\n", This
, p
);
798 nsres
= nsIDOMHTMLTableRowElement_GetSectionRowIndex(This
->nsrow
, p
);
799 if(NS_FAILED(nsres
)) {
800 ERR("Get selectionRowIndex failed: %08lx\n", nsres
);
806 static HRESULT WINAPI
HTMLTableRow_get_cells(IHTMLTableRow
*iface
, IHTMLElementCollection
**p
)
808 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
809 nsIDOMHTMLCollection
*nscol
;
812 TRACE("(%p)->(%p)\n", This
, p
);
814 nsres
= nsIDOMHTMLTableRowElement_GetCells(This
->nsrow
, &nscol
);
815 if(NS_FAILED(nsres
)) {
816 ERR("GetCells failed: %08lx\n", nsres
);
820 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
822 nsIDOMHTMLCollection_Release(nscol
);
826 static HRESULT WINAPI
HTMLTableRow_insertCell(IHTMLTableRow
*iface
, LONG index
, IDispatch
**row
)
828 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
829 nsIDOMHTMLElement
*nselem
;
834 TRACE("(%p)->(%ld %p)\n", This
, index
, row
);
835 nsres
= nsIDOMHTMLTableRowElement_InsertCell(This
->nsrow
, index
, &nselem
);
836 if(NS_FAILED(nsres
)) {
837 ERR("Insert Cell at %ld failed: %08lx\n", index
, nsres
);
841 hres
= HTMLTableCell_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
842 nsIDOMHTMLElement_Release(nselem
);
844 ERR("Create TableCell failed: %08lx\n", hres
);
848 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
852 static HRESULT WINAPI
HTMLTableRow_deleteCell(IHTMLTableRow
*iface
, LONG index
)
854 HTMLTableRow
*This
= impl_from_IHTMLTableRow(iface
);
857 TRACE("(%p)->(%ld)\n", This
, index
);
858 nsres
= nsIDOMHTMLTableRowElement_DeleteCell(This
->nsrow
, index
);
859 if(NS_FAILED(nsres
)) {
860 ERR("Delete Cell failed: %08lx\n", nsres
);
866 static const IHTMLTableRowVtbl HTMLTableRowVtbl
= {
867 HTMLTableRow_QueryInterface
,
869 HTMLTableRow_Release
,
870 HTMLTableRow_GetTypeInfoCount
,
871 HTMLTableRow_GetTypeInfo
,
872 HTMLTableRow_GetIDsOfNames
,
874 HTMLTableRow_put_align
,
875 HTMLTableRow_get_align
,
876 HTMLTableRow_put_vAlign
,
877 HTMLTableRow_get_vAlign
,
878 HTMLTableRow_put_bgColor
,
879 HTMLTableRow_get_bgColor
,
880 HTMLTableRow_put_borderColor
,
881 HTMLTableRow_get_borderColor
,
882 HTMLTableRow_put_borderColorLight
,
883 HTMLTableRow_get_borderColorLight
,
884 HTMLTableRow_put_borderColorDark
,
885 HTMLTableRow_get_borderColorDark
,
886 HTMLTableRow_get_rowIndex
,
887 HTMLTableRow_get_sectionRowIndex
,
888 HTMLTableRow_get_cells
,
889 HTMLTableRow_insertCell
,
890 HTMLTableRow_deleteCell
893 static inline HTMLTableRow
*HTMLTableRow_from_HTMLDOMNode(HTMLDOMNode
*iface
)
895 return CONTAINING_RECORD(iface
, HTMLTableRow
, element
.node
);
898 static HRESULT
HTMLTableRow_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
900 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
904 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
905 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
906 *ppv
= &This
->IHTMLTableRow_iface
;
907 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
908 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
909 *ppv
= &This
->IHTMLTableRow_iface
;
910 }else if(IsEqualGUID(&IID_IHTMLTableRow
, riid
)) {
911 TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This
, ppv
);
912 *ppv
= &This
->IHTMLTableRow_iface
;
916 IUnknown_AddRef((IUnknown
*)*ppv
);
920 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
923 static void HTMLTableRow_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
925 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
928 note_cc_edge((nsISupports
*)This
->nsrow
, "This->nstablerow", cb
);
931 static void HTMLTableRow_unlink(HTMLDOMNode
*iface
)
933 HTMLTableRow
*This
= HTMLTableRow_from_HTMLDOMNode(iface
);
936 nsIDOMHTMLTableRowElement
*nsrow
= This
->nsrow
;
939 nsIDOMHTMLTableRowElement_Release(nsrow
);
943 static const NodeImplVtbl HTMLTableRowImplVtbl
= {
946 HTMLElement_destructor
,
949 HTMLElement_dispatch_nsevent_hook
,
950 HTMLElement_handle_event
,
951 HTMLElement_get_attr_col
,
961 HTMLTableRow_traverse
,
965 static const tid_t HTMLTableRow_iface_tids
[] = {
971 static dispex_static_data_t HTMLTableRow_dispex
= {
972 L
"HTMLTableRowElement",
974 DispHTMLTableRow_tid
,
975 HTMLTableRow_iface_tids
,
976 HTMLElement_init_dispex_info
979 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
984 ret
= calloc(1, sizeof(HTMLTableRow
));
986 return E_OUTOFMEMORY
;
988 ret
->IHTMLTableRow_iface
.lpVtbl
= &HTMLTableRowVtbl
;
989 ret
->element
.node
.vtbl
= &HTMLTableRowImplVtbl
;
991 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTableRow_dispex
);
993 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableRowElement
, (void**)&ret
->nsrow
);
994 assert(nsres
== NS_OK
);
996 *elem
= &ret
->element
;
1001 HTMLElement element
;
1003 IHTMLTable IHTMLTable_iface
;
1004 IHTMLTable2 IHTMLTable2_iface
;
1005 IHTMLTable3 IHTMLTable3_iface
;
1007 nsIDOMHTMLTableElement
*nstable
;
1010 static inline HTMLTable
*impl_from_IHTMLTable(IHTMLTable
*iface
)
1012 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable_iface
);
1015 static inline HTMLTable
*impl_from_IHTMLTable2(IHTMLTable2
*iface
)
1017 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable2_iface
);
1020 static inline HTMLTable
*impl_from_IHTMLTable3(IHTMLTable3
*iface
)
1022 return CONTAINING_RECORD(iface
, HTMLTable
, IHTMLTable3_iface
);
1025 static HRESULT
var2str(const VARIANT
*p
, nsAString
*nsstr
)
1033 return nsAString_Init(nsstr
, V_BSTR(p
))?
1034 S_OK
: E_OUTOFMEMORY
;
1036 hres
= VarBstrFromR8(V_R8(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1039 hres
= VarBstrFromR4(V_R4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1042 hres
= VarBstrFromI4(V_I4(p
), MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, &str
);
1045 FIXME("unsupported arg %s\n", debugstr_variant(p
));
1051 ret
= nsAString_Init(nsstr
, str
);
1053 return ret
? S_OK
: E_OUTOFMEMORY
;
1056 static HRESULT WINAPI
HTMLTable_QueryInterface(IHTMLTable
*iface
,
1057 REFIID riid
, void **ppv
)
1059 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1061 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1064 static ULONG WINAPI
HTMLTable_AddRef(IHTMLTable
*iface
)
1066 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1068 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1071 static ULONG WINAPI
HTMLTable_Release(IHTMLTable
*iface
)
1073 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1075 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1078 static HRESULT WINAPI
HTMLTable_GetTypeInfoCount(IHTMLTable
*iface
, UINT
*pctinfo
)
1080 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1081 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1084 static HRESULT WINAPI
HTMLTable_GetTypeInfo(IHTMLTable
*iface
, UINT iTInfo
,
1085 LCID lcid
, ITypeInfo
**ppTInfo
)
1087 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1088 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1092 static HRESULT WINAPI
HTMLTable_GetIDsOfNames(IHTMLTable
*iface
, REFIID riid
,
1093 LPOLESTR
*rgszNames
, UINT cNames
,
1094 LCID lcid
, DISPID
*rgDispId
)
1096 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1097 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1098 cNames
, lcid
, rgDispId
);
1101 static HRESULT WINAPI
HTMLTable_Invoke(IHTMLTable
*iface
, DISPID dispIdMember
,
1102 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1103 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1105 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1106 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1107 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1110 static HRESULT WINAPI
HTMLTable_put_cols(IHTMLTable
*iface
, LONG v
)
1112 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1113 FIXME("(%p)->(%ld)\n", This
, v
);
1117 static HRESULT WINAPI
HTMLTable_get_cols(IHTMLTable
*iface
, LONG
*p
)
1119 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1120 FIXME("(%p)->(%p)\n", This
, p
);
1124 static HRESULT WINAPI
HTMLTable_put_border(IHTMLTable
*iface
, VARIANT v
)
1126 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1127 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1131 static HRESULT WINAPI
HTMLTable_get_border(IHTMLTable
*iface
, VARIANT
*p
)
1133 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1134 FIXME("(%p)->(%p)\n", This
, p
);
1138 static HRESULT WINAPI
HTMLTable_put_frame(IHTMLTable
*iface
, BSTR v
)
1140 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1144 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1146 nsAString_InitDepend(&str
, v
);
1147 nsres
= nsIDOMHTMLTableElement_SetFrame(This
->nstable
, &str
);
1148 nsAString_Finish(&str
);
1150 if (NS_FAILED(nsres
)) {
1151 ERR("SetFrame(%s) failed: %08lx\n", debugstr_w(v
), nsres
);
1157 static HRESULT WINAPI
HTMLTable_get_frame(IHTMLTable
*iface
, BSTR
*p
)
1159 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1163 TRACE("(%p)->(%p)\n", This
, p
);
1165 nsAString_Init(&str
, NULL
);
1166 nsres
= nsIDOMHTMLTableElement_GetFrame(This
->nstable
, &str
);
1168 return return_nsstr(nsres
, &str
, p
);
1171 static HRESULT WINAPI
HTMLTable_put_rules(IHTMLTable
*iface
, BSTR v
)
1173 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1174 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1178 static HRESULT WINAPI
HTMLTable_get_rules(IHTMLTable
*iface
, BSTR
*p
)
1180 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1181 FIXME("(%p)->(%p)\n", This
, p
);
1185 static HRESULT WINAPI
HTMLTable_put_cellSpacing(IHTMLTable
*iface
, VARIANT v
)
1187 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1192 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1196 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
1199 swprintf(buf
, ARRAY_SIZE(buf
), L
"%d", V_I4(&v
));
1200 nsAString_InitDepend(&nsstr
, buf
);
1204 FIXME("unsupported arg %s\n", debugstr_variant(&v
));
1208 nsres
= nsIDOMHTMLTableElement_SetCellSpacing(This
->nstable
, &nsstr
);
1209 nsAString_Finish(&nsstr
);
1210 if(NS_FAILED(nsres
)) {
1211 ERR("SetCellSpacing failed: %08lx\n", nsres
);
1218 static HRESULT WINAPI
HTMLTable_get_cellSpacing(IHTMLTable
*iface
, VARIANT
*p
)
1220 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1224 TRACE("(%p)->(%p)\n", This
, p
);
1226 nsAString_Init(&nsstr
, NULL
);
1227 nsres
= nsIDOMHTMLTableElement_GetCellSpacing(This
->nstable
, &nsstr
);
1229 return return_nsstr(nsres
, &nsstr
, &V_BSTR(p
));
1232 static HRESULT WINAPI
HTMLTable_put_cellPadding(IHTMLTable
*iface
, VARIANT v
)
1234 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1239 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1241 hres
= var2str(&v
, &val
);
1245 nsres
= nsIDOMHTMLTableElement_SetCellPadding(This
->nstable
, &val
);
1246 nsAString_Finish(&val
);
1247 if(NS_FAILED(nsres
)) {
1248 ERR("Set Width(%s) failed, err = %08lx\n", debugstr_variant(&v
), nsres
);
1255 static HRESULT WINAPI
HTMLTable_get_cellPadding(IHTMLTable
*iface
, VARIANT
*p
)
1257 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1261 TRACE("(%p)->(%p)\n", This
, p
);
1263 nsAString_Init(&val
, NULL
);
1264 nsres
= nsIDOMHTMLTableElement_GetCellPadding(This
->nstable
, &val
);
1265 return return_nsstr_variant(nsres
, &val
, 0, p
);
1268 static HRESULT WINAPI
HTMLTable_put_background(IHTMLTable
*iface
, BSTR v
)
1270 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1271 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1275 static HRESULT WINAPI
HTMLTable_get_background(IHTMLTable
*iface
, BSTR
*p
)
1277 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1278 FIXME("(%p)->(%p)\n", This
, p
);
1282 static HRESULT WINAPI
HTMLTable_put_bgColor(IHTMLTable
*iface
, VARIANT v
)
1284 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1288 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1290 if(!variant_to_nscolor(&v
, &val
))
1293 nsres
= nsIDOMHTMLTableElement_SetBgColor(This
->nstable
, &val
);
1294 nsAString_Finish(&val
);
1295 if (NS_FAILED(nsres
)){
1296 ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v
));
1303 static HRESULT WINAPI
HTMLTable_get_bgColor(IHTMLTable
*iface
, VARIANT
*p
)
1305 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1309 const PRUnichar
*color
;
1311 TRACE("(%p)->(%p)\n", This
, p
);
1313 nsAString_Init(&strColor
, NULL
);
1314 nsres
= nsIDOMHTMLTableElement_GetBgColor(This
->nstable
, &strColor
);
1316 if(NS_SUCCEEDED(nsres
)) {
1317 nsAString_GetData(&strColor
, &color
);
1319 hres
= nscolor_to_str(color
, &V_BSTR(p
));
1321 ERR("SetBgColor failed: %08lx\n", nsres
);
1325 nsAString_Finish(&strColor
);
1329 static HRESULT WINAPI
HTMLTable_put_borderColor(IHTMLTable
*iface
, VARIANT v
)
1331 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1332 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1336 static HRESULT WINAPI
HTMLTable_get_borderColor(IHTMLTable
*iface
, VARIANT
*p
)
1338 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1339 FIXME("(%p)->(%p)\n", This
, p
);
1343 static HRESULT WINAPI
HTMLTable_put_borderColorLight(IHTMLTable
*iface
, VARIANT v
)
1345 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1346 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1350 static HRESULT WINAPI
HTMLTable_get_borderColorLight(IHTMLTable
*iface
, VARIANT
*p
)
1352 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1353 FIXME("(%p)->(%p)\n", This
, p
);
1357 static HRESULT WINAPI
HTMLTable_put_borderColorDark(IHTMLTable
*iface
, VARIANT v
)
1359 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1360 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1364 static HRESULT WINAPI
HTMLTable_get_borderColorDark(IHTMLTable
*iface
, VARIANT
*p
)
1366 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1367 FIXME("(%p)->(%p)\n", This
, p
);
1371 static HRESULT WINAPI
HTMLTable_put_align(IHTMLTable
*iface
, BSTR v
)
1373 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1377 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1379 nsAString_InitDepend(&val
, v
);
1381 nsres
= nsIDOMHTMLTableElement_SetAlign(This
->nstable
, &val
);
1382 nsAString_Finish(&val
);
1383 if (NS_FAILED(nsres
)){
1384 ERR("Set Align(%s) failed!\n", debugstr_w(v
));
1390 static HRESULT WINAPI
HTMLTable_get_align(IHTMLTable
*iface
, BSTR
*p
)
1392 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1396 TRACE("(%p)->(%p)\n", This
, p
);
1398 nsAString_Init(&val
, NULL
);
1399 nsres
= nsIDOMHTMLTableElement_GetAlign(This
->nstable
, &val
);
1401 return return_nsstr(nsres
, &val
, p
);
1404 static HRESULT WINAPI
HTMLTable_refresh(IHTMLTable
*iface
)
1406 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1407 FIXME("(%p)\n", This
);
1411 static HRESULT WINAPI
HTMLTable_get_rows(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1413 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1414 nsIDOMHTMLCollection
*nscol
;
1417 TRACE("(%p)->(%p)\n", This
, p
);
1419 nsres
= nsIDOMHTMLTableElement_GetRows(This
->nstable
, &nscol
);
1420 if(NS_FAILED(nsres
)) {
1421 ERR("GetRows failed: %08lx\n", nsres
);
1425 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1427 nsIDOMHTMLCollection_Release(nscol
);
1431 static HRESULT WINAPI
HTMLTable_put_width(IHTMLTable
*iface
, VARIANT v
)
1433 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1438 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1439 hres
= var2str(&v
, &val
);
1442 ERR("Set Width(%s) failed when initializing a nsAString, err = %08lx\n",
1443 debugstr_variant(&v
), hres
);
1447 nsres
= nsIDOMHTMLTableElement_SetWidth(This
->nstable
, &val
);
1448 nsAString_Finish(&val
);
1450 if (NS_FAILED(nsres
)){
1451 ERR("Set Width(%s) failed, err = %08lx\n", debugstr_variant(&v
), nsres
);
1457 static HRESULT WINAPI
HTMLTable_get_width(IHTMLTable
*iface
, VARIANT
*p
)
1459 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1463 TRACE("(%p)->(%p)\n", This
, p
);
1465 nsAString_Init(&val
, NULL
);
1466 nsres
= nsIDOMHTMLTableElement_GetWidth(This
->nstable
, &val
);
1467 return return_nsstr_variant(nsres
, &val
, NSSTR_IMPLICIT_PX
, p
);
1470 static HRESULT WINAPI
HTMLTable_put_height(IHTMLTable
*iface
, VARIANT v
)
1472 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1473 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1477 static HRESULT WINAPI
HTMLTable_get_height(IHTMLTable
*iface
, VARIANT
*p
)
1479 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1480 FIXME("(%p)->(%p)\n", This
, p
);
1484 static HRESULT WINAPI
HTMLTable_put_dataPageSize(IHTMLTable
*iface
, LONG v
)
1486 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1487 FIXME("(%p)->(%ld)\n", This
, v
);
1491 static HRESULT WINAPI
HTMLTable_get_dataPageSize(IHTMLTable
*iface
, LONG
*p
)
1493 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1494 FIXME("(%p)->(%p)\n", This
, p
);
1498 static HRESULT WINAPI
HTMLTable_nextPage(IHTMLTable
*iface
)
1500 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1501 FIXME("(%p)\n", This
);
1505 static HRESULT WINAPI
HTMLTable_previousPage(IHTMLTable
*iface
)
1507 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1508 FIXME("(%p)\n", This
);
1512 static HRESULT WINAPI
HTMLTable_get_tHead(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1514 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1515 FIXME("(%p)->(%p)\n", This
, p
);
1519 static HRESULT WINAPI
HTMLTable_get_tFoot(IHTMLTable
*iface
, IHTMLTableSection
**p
)
1521 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1522 FIXME("(%p)->(%p)\n", This
, p
);
1526 static HRESULT WINAPI
HTMLTable_get_tBodies(IHTMLTable
*iface
, IHTMLElementCollection
**p
)
1528 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1529 nsIDOMHTMLCollection
*nscol
= NULL
;
1532 TRACE("(%p)->(%p)\n", This
, p
);
1534 nsres
= nsIDOMHTMLTableElement_GetTBodies(This
->nstable
, &nscol
);
1535 if(NS_FAILED(nsres
)) {
1536 ERR("GetTBodies failed: %08lx\n", nsres
);
1540 *p
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->element
.node
.event_target
.dispex
));
1542 nsIDOMHTMLCollection_Release(nscol
);
1546 static HRESULT WINAPI
HTMLTable_get_caption(IHTMLTable
*iface
, IHTMLTableCaption
**p
)
1548 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1549 FIXME("(%p)->(%p)\n", This
, p
);
1553 static HRESULT WINAPI
HTMLTable_createTHead(IHTMLTable
*iface
, IDispatch
**head
)
1555 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1556 FIXME("(%p)->(%p)\n", This
, head
);
1560 static HRESULT WINAPI
HTMLTable_deleteTHead(IHTMLTable
*iface
)
1562 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1563 FIXME("(%p)\n", This
);
1567 static HRESULT WINAPI
HTMLTable_createTFoot(IHTMLTable
*iface
, IDispatch
**foot
)
1569 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1570 FIXME("(%p)->(%p)\n", This
, foot
);
1574 static HRESULT WINAPI
HTMLTable_deleteTFoot(IHTMLTable
*iface
)
1576 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1577 FIXME("(%p)\n", This
);
1581 static HRESULT WINAPI
HTMLTable_createCaption(IHTMLTable
*iface
, IHTMLTableCaption
**caption
)
1583 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1584 FIXME("(%p)->(%p)\n", This
, caption
);
1588 static HRESULT WINAPI
HTMLTable_deleteCaption(IHTMLTable
*iface
)
1590 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1591 FIXME("(%p)\n", This
);
1595 static HRESULT WINAPI
HTMLTable_insertRow(IHTMLTable
*iface
, LONG index
, IDispatch
**row
)
1597 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1598 nsIDOMHTMLElement
*nselem
;
1603 TRACE("(%p)->(%ld %p)\n", This
, index
, row
);
1604 nsres
= nsIDOMHTMLTableElement_InsertRow(This
->nstable
, index
, &nselem
);
1605 if(NS_FAILED(nsres
)) {
1606 ERR("Insert Row at %ld failed: %08lx\n", index
, nsres
);
1610 hres
= HTMLTableRow_Create(This
->element
.node
.doc
, (nsIDOMElement
*)nselem
, &elem
);
1611 nsIDOMHTMLElement_Release(nselem
);
1613 ERR("Create TableRow failed: %08lx\n", hres
);
1617 *row
= (IDispatch
*)&elem
->IHTMLElement_iface
;
1621 static HRESULT WINAPI
HTMLTable_deleteRow(IHTMLTable
*iface
, LONG index
)
1623 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1626 TRACE("(%p)->(%ld)\n", This
, index
);
1627 nsres
= nsIDOMHTMLTableElement_DeleteRow(This
->nstable
, index
);
1628 if(NS_FAILED(nsres
)) {
1629 ERR("Delete Row failed: %08lx\n", nsres
);
1635 static HRESULT WINAPI
HTMLTable_get_readyState(IHTMLTable
*iface
, BSTR
*p
)
1637 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1638 FIXME("(%p)->(%p)\n", This
, p
);
1642 static HRESULT WINAPI
HTMLTable_put_onreadystatechange(IHTMLTable
*iface
, VARIANT v
)
1644 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1645 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1649 static HRESULT WINAPI
HTMLTable_get_onreadystatechange(IHTMLTable
*iface
, VARIANT
*p
)
1651 HTMLTable
*This
= impl_from_IHTMLTable(iface
);
1652 FIXME("(%p)->(%p)\n", This
, p
);
1656 static const IHTMLTableVtbl HTMLTableVtbl
= {
1657 HTMLTable_QueryInterface
,
1660 HTMLTable_GetTypeInfoCount
,
1661 HTMLTable_GetTypeInfo
,
1662 HTMLTable_GetIDsOfNames
,
1666 HTMLTable_put_border
,
1667 HTMLTable_get_border
,
1668 HTMLTable_put_frame
,
1669 HTMLTable_get_frame
,
1670 HTMLTable_put_rules
,
1671 HTMLTable_get_rules
,
1672 HTMLTable_put_cellSpacing
,
1673 HTMLTable_get_cellSpacing
,
1674 HTMLTable_put_cellPadding
,
1675 HTMLTable_get_cellPadding
,
1676 HTMLTable_put_background
,
1677 HTMLTable_get_background
,
1678 HTMLTable_put_bgColor
,
1679 HTMLTable_get_bgColor
,
1680 HTMLTable_put_borderColor
,
1681 HTMLTable_get_borderColor
,
1682 HTMLTable_put_borderColorLight
,
1683 HTMLTable_get_borderColorLight
,
1684 HTMLTable_put_borderColorDark
,
1685 HTMLTable_get_borderColorDark
,
1686 HTMLTable_put_align
,
1687 HTMLTable_get_align
,
1690 HTMLTable_put_width
,
1691 HTMLTable_get_width
,
1692 HTMLTable_put_height
,
1693 HTMLTable_get_height
,
1694 HTMLTable_put_dataPageSize
,
1695 HTMLTable_get_dataPageSize
,
1697 HTMLTable_previousPage
,
1698 HTMLTable_get_tHead
,
1699 HTMLTable_get_tFoot
,
1700 HTMLTable_get_tBodies
,
1701 HTMLTable_get_caption
,
1702 HTMLTable_createTHead
,
1703 HTMLTable_deleteTHead
,
1704 HTMLTable_createTFoot
,
1705 HTMLTable_deleteTFoot
,
1706 HTMLTable_createCaption
,
1707 HTMLTable_deleteCaption
,
1708 HTMLTable_insertRow
,
1709 HTMLTable_deleteRow
,
1710 HTMLTable_get_readyState
,
1711 HTMLTable_put_onreadystatechange
,
1712 HTMLTable_get_onreadystatechange
1716 static HRESULT WINAPI
HTMLTable2_QueryInterface(IHTMLTable2
*iface
,
1717 REFIID riid
, void **ppv
)
1719 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1721 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1724 static ULONG WINAPI
HTMLTable2_AddRef(IHTMLTable2
*iface
)
1726 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1728 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1731 static ULONG WINAPI
HTMLTable2_Release(IHTMLTable2
*iface
)
1733 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1735 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1738 static HRESULT WINAPI
HTMLTable2_GetTypeInfoCount(IHTMLTable2
*iface
, UINT
*pctinfo
)
1740 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1741 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1744 static HRESULT WINAPI
HTMLTable2_GetTypeInfo(IHTMLTable2
*iface
, UINT iTInfo
,
1745 LCID lcid
, ITypeInfo
**ppTInfo
)
1747 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1748 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1752 static HRESULT WINAPI
HTMLTable2_GetIDsOfNames(IHTMLTable2
*iface
, REFIID riid
,
1753 LPOLESTR
*rgszNames
, UINT cNames
,
1754 LCID lcid
, DISPID
*rgDispId
)
1756 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1757 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1758 cNames
, lcid
, rgDispId
);
1761 static HRESULT WINAPI
HTMLTable2_Invoke(IHTMLTable2
*iface
, DISPID dispIdMember
,
1762 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1763 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1765 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1766 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1767 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1770 static HRESULT WINAPI
HTMLTable2_firstPage(IHTMLTable2
*iface
)
1772 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1773 FIXME("(%p)->()\n", This
);
1777 static HRESULT WINAPI
HTMLTable2_lastPage(IHTMLTable2
*iface
)
1779 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1780 FIXME("(%p)->()\n", This
);
1784 static HRESULT WINAPI
HTMLTable2_cells(IHTMLTable2
*iface
, IHTMLElementCollection
**p
)
1786 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1787 FIXME("(%p)->(%p)\n", This
, p
);
1791 static HRESULT WINAPI
HTMLTable2_moveRow(IHTMLTable2
*iface
, LONG indexFrom
, LONG indexTo
, IDispatch
**row
)
1793 HTMLTable
*This
= impl_from_IHTMLTable2(iface
);
1794 FIXME("(%p)->(%ld %ld %p)\n", This
, indexFrom
, indexTo
, row
);
1799 static const IHTMLTable2Vtbl HTMLTable2Vtbl
= {
1800 HTMLTable2_QueryInterface
,
1803 HTMLTable2_GetTypeInfoCount
,
1804 HTMLTable2_GetTypeInfo
,
1805 HTMLTable2_GetIDsOfNames
,
1807 HTMLTable2_firstPage
,
1808 HTMLTable2_lastPage
,
1814 static HRESULT WINAPI
HTMLTable3_QueryInterface(IHTMLTable3
*iface
,
1815 REFIID riid
, void **ppv
)
1817 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1819 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
1822 static ULONG WINAPI
HTMLTable3_AddRef(IHTMLTable3
*iface
)
1824 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1826 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
1829 static ULONG WINAPI
HTMLTable3_Release(IHTMLTable3
*iface
)
1831 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1833 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
1836 static HRESULT WINAPI
HTMLTable3_GetTypeInfoCount(IHTMLTable3
*iface
, UINT
*pctinfo
)
1838 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1839 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1842 static HRESULT WINAPI
HTMLTable3_GetTypeInfo(IHTMLTable3
*iface
, UINT iTInfo
,
1843 LCID lcid
, ITypeInfo
**ppTInfo
)
1845 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1846 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
1850 static HRESULT WINAPI
HTMLTable3_GetIDsOfNames(IHTMLTable3
*iface
, REFIID riid
,
1851 LPOLESTR
*rgszNames
, UINT cNames
,
1852 LCID lcid
, DISPID
*rgDispId
)
1854 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1855 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
1856 cNames
, lcid
, rgDispId
);
1859 static HRESULT WINAPI
HTMLTable3_Invoke(IHTMLTable3
*iface
, DISPID dispIdMember
,
1860 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1861 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1863 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1864 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
1865 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1868 static HRESULT WINAPI
HTMLTable3_put_summary(IHTMLTable3
*iface
, BSTR v
)
1870 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1874 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1876 nsAString_InitDepend(&str
, v
);
1878 nsres
= nsIDOMHTMLTableElement_SetSummary(This
->nstable
, &str
);
1880 nsAString_Finish(&str
);
1881 if (NS_FAILED(nsres
)) {
1882 ERR("Set summary(%s) failed: %08lx\n", debugstr_w(v
), nsres
);
1888 static HRESULT WINAPI
HTMLTable3_get_summary(IHTMLTable3
*iface
, BSTR
* p
)
1890 HTMLTable
*This
= impl_from_IHTMLTable3(iface
);
1894 TRACE("(%p)->(%p)\n", This
, p
);
1896 nsAString_Init(&str
, NULL
);
1897 nsres
= nsIDOMHTMLTableElement_GetSummary(This
->nstable
, &str
);
1899 return return_nsstr(nsres
, &str
, p
);
1902 static const IHTMLTable3Vtbl HTMLTable3Vtbl
= {
1903 HTMLTable3_QueryInterface
,
1906 HTMLTable3_GetTypeInfoCount
,
1907 HTMLTable3_GetTypeInfo
,
1908 HTMLTable3_GetIDsOfNames
,
1910 HTMLTable3_put_summary
,
1911 HTMLTable3_get_summary
1914 static inline HTMLTable
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1916 return CONTAINING_RECORD(iface
, HTMLTable
, element
.node
);
1919 static HRESULT
HTMLTable_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1921 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1925 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1926 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1927 *ppv
= &This
->IHTMLTable_iface
;
1928 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1929 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1930 *ppv
= &This
->IHTMLTable_iface
;
1931 }else if(IsEqualGUID(&IID_IHTMLTable
, riid
)) {
1932 TRACE("(%p)->(IID_IHTMLTable %p)\n", This
, ppv
);
1933 *ppv
= &This
->IHTMLTable_iface
;
1934 }else if(IsEqualGUID(&IID_IHTMLTable2
, riid
)) {
1935 TRACE("(%p)->(IID_IHTMLTable2 %p)\n", This
, ppv
);
1936 *ppv
= &This
->IHTMLTable2_iface
;
1937 }else if(IsEqualGUID(&IID_IHTMLTable3
, riid
)) {
1938 TRACE("(%p)->(IID_IHTMLTable3 %p)\n", This
, ppv
);
1939 *ppv
= &This
->IHTMLTable3_iface
;
1943 IUnknown_AddRef((IUnknown
*)*ppv
);
1947 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1950 static void HTMLTable_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
1952 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1955 note_cc_edge((nsISupports
*)This
->nstable
, "This->nstable", cb
);
1958 static void HTMLTable_unlink(HTMLDOMNode
*iface
)
1960 HTMLTable
*This
= impl_from_HTMLDOMNode(iface
);
1963 nsIDOMHTMLTableElement
*nstable
= This
->nstable
;
1965 This
->nstable
= NULL
;
1966 nsIDOMHTMLTableElement_Release(nstable
);
1970 static const cpc_entry_t HTMLTable_cpc
[] = {
1971 {&DIID_HTMLTableEvents
},
1976 static const NodeImplVtbl HTMLTableImplVtbl
= {
1979 HTMLElement_destructor
,
1982 HTMLElement_dispatch_nsevent_hook
,
1983 HTMLElement_handle_event
,
1984 HTMLElement_get_attr_col
,
1998 static const tid_t HTMLTable_iface_tids
[] = {
2006 static dispex_static_data_t HTMLTable_dispex
= {
2007 L
"HTMLTableElement",
2010 HTMLTable_iface_tids
,
2011 HTMLElement_init_dispex_info
2014 HRESULT
HTMLTable_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
2019 ret
= calloc(1, sizeof(HTMLTable
));
2021 return E_OUTOFMEMORY
;
2023 ret
->element
.node
.vtbl
= &HTMLTableImplVtbl
;
2024 ret
->IHTMLTable_iface
.lpVtbl
= &HTMLTableVtbl
;
2025 ret
->IHTMLTable2_iface
.lpVtbl
= &HTMLTable2Vtbl
;
2026 ret
->IHTMLTable3_iface
.lpVtbl
= &HTMLTable3Vtbl
;
2028 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLTable_dispex
);
2030 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLTableElement
, (void**)&ret
->nstable
);
2031 assert(nsres
== NS_OK
);
2033 *elem
= &ret
->element
;