59 *
ppv = &
This->IEnumVARIANT_iface;
61 *
ppv = &
This->IEnumVARIANT_iface;
90 IHTMLDOMChildrenCollection_Release(&
This->col->IHTMLDOMChildrenCollection_iface);
102 nsres = nsIDOMNodeList_GetLength(
This->col->nslist, &
len);
116 TRACE(
"(%p)->(%d %p %p)\n",
This, celt, rgVar, pCeltFetched);
120 while(
This->iter+fetched <
len && fetched < celt) {
121 nsres = nsIDOMNodeList_Item(
This->col->nslist,
This->iter+fetched, &nsnode);
125 nsIDOMNode_Release(nsnode);
127 ERR(
"get_node failed: %08x\n",
hres);
132 IHTMLDOMNode_AddRef(&
node->IHTMLDOMNode_iface);
137 This->iter += fetched;
139 *pCeltFetched = fetched;
199 *
ppv = &
This->IHTMLDOMChildrenCollection_iface;
201 *
ppv = &
This->IHTMLDOMChildrenCollection_iface;
233 nsIDOMNodeList_Release(
This->nslist);
243 return IDispatchEx_GetTypeInfoCount(&
This->dispex.IDispatchEx_iface, pctinfo);
250 return IDispatchEx_GetTypeInfo(&
This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
257 return IDispatchEx_GetIDsOfNames(&
This->dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
263 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
266 return IDispatchEx_Invoke(&
This->dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
267 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
277 nsIDOMNodeList_GetLength(
This->nslist, &
length);
297 IHTMLDOMChildrenCollection_AddRef(&
This->IHTMLDOMChildrenCollection_iface);
320 nsIDOMNodeList_GetLength(
This->nslist, &
length);
321 if(index < 0 || index >=
length)
324 nsres = nsIDOMNodeList_Item(
This->nslist,
index, &nsnode);
326 ERR(
"Item failed: %08x\n", nsres);
356#define DISPID_CHILDCOL_0 MSHTML_DISPID_CUSTOM_MIN
370 nsIDOMNodeList_GetLength(
This->nslist, &
len);
375 TRACE(
"ret %x\n", *dispid);
391 hres = IHTMLDOMChildrenCollection_item(&
This->IHTMLDOMChildrenCollection_iface,
417 IHTMLDOMChildrenCollection_tid,
423 DispDOMChildrenCollection_tid,
432 ret = heap_alloc_zero(
sizeof(*
ret));
439 nsIDOMNodeList_AddRef(nslist);
440 ret->nslist = nslist;
448 return &
ret->IHTMLDOMChildrenCollection_iface;
489 return IDispatchEx_GetTypeInfoCount(&
This->event_target.dispex.IDispatchEx_iface, pctinfo);
496 return IDispatchEx_GetTypeInfo(&
This->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
504 return IDispatchEx_GetIDsOfNames(&
This->event_target.dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
510 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
513 return IDispatchEx_Invoke(&
This->event_target.dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
514 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
524 nsIDOMNode_GetNodeType(
This->nsnode, &
type);
534 case DOCUMENT_TYPE_NODE:
540 case DOCUMENT_FRAGMENT_NODE:
566 nsres = nsIDOMNode_GetParentNode(
This->nsnode, &nsnode);
568 ERR(
"GetParentNode failed: %08x\n", nsres);
578 nsIDOMNode_Release(nsnode);
582 *
p = &
node->IHTMLDOMNode_iface;
594 nsres = nsIDOMNode_HasChildNodes(
This->nsnode, &has_child);
596 ERR(
"HasChildNodes failed: %08x\n", nsres);
598 *fChildren = has_child ? VARIANT_TRUE : VARIANT_FALSE;
610 nsres = nsIDOMNode_GetChildNodes(
This->nsnode, &nslist);
612 ERR(
"GetChildNodes failed: %08x\n", nsres);
617 nsIDOMNodeList_Release(nslist);
630 if(
This->vtbl->get_attr_col) {
656 ERR(
"invalid newChild\n");
660 switch(
V_VT(&refChild)) {
664 IHTMLDOMNode *ref_iface;
669 hres = IDispatch_QueryInterface(
V_DISPATCH(&refChild), &IID_IHTMLDOMNode, (
void**)&ref_iface);
674 IHTMLDOMNode_Release(ref_iface);
676 ERR(
"unvalid node\n");
688 nsres = nsIDOMNode_InsertBefore(
This->nsnode, new_child->
nsnode, ref_node ? ref_node->
nsnode :
NULL, &nsnode);
690 ERR(
"InsertBefore failed: %08x\n", nsres);
701 nsIDOMNode_Release(nsnode);
724 nsres = nsIDOMNode_RemoveChild(
This->nsnode, node_obj->
nsnode, &nsnode);
727 ERR(
"RemoveChild failed: %08x\n", nsres);
732 nsIDOMNode_Release(nsnode);
742 IHTMLDOMNode *oldChild, IHTMLDOMNode **
node)
762 nsres = nsIDOMNode_ReplaceChild(
This->nsnode, node_new->
nsnode, node_old->
nsnode, &nsnode);
769 nsIDOMNode_Release(nsnode);
778 IHTMLDOMNode **clonedNode)
786 TRACE(
"(%p)->(%x %p)\n",
This, fDeep, clonedNode);
788 nsres = nsIDOMNode_CloneNode(
This->nsnode, fDeep != VARIANT_FALSE, 1, &nsnode);
790 ERR(
"CloneNode failed: %08x\n", nsres);
803 IHTMLDOMNode **removed)
806 FIXME(
"(%p)->(%x %p)\n",
This, fDeep, removed);
811 IHTMLDOMNode **swappedNode)
814 FIXME(
"(%p)->(%p %p)\n",
This, otherNode, swappedNode);
819 IHTMLDOMNode **replaced)
822 FIXME(
"(%p)->(%p %p)\n",
This, replacement, replaced);
841 nsres = nsIDOMNode_AppendChild(
This->nsnode, node_obj->
nsnode, &nsnode);
844 ERR(
"AppendChild failed: %08x\n", nsres);
849 nsIDOMNode_Release(nsnode);
867 nsres = nsIDOMNode_GetNodeName(
This->nsnode, &
name);
882 nsIDOMNode_SetNodeValue(
This->nsnode, &val_str);
904 nsIDOMNode_GetNodeValue(
This->nsnode, &val_str);
928 nsIDOMNode_GetFirstChild(
This->nsnode, &nschild);
935 nsIDOMNode_Release(nschild);
939 *
p = &
node->IHTMLDOMNode_iface;
952 nsIDOMNode_GetLastChild(
This->nsnode, &nschild);
959 nsIDOMNode_Release(nschild);
963 *
p = &
node->IHTMLDOMNode_iface;
976 nsIDOMNode_GetPreviousSibling(
This->nsnode, &nschild);
983 nsIDOMNode_Release(nschild);
987 *
p = &
node->IHTMLDOMNode_iface;
1000 nsIDOMNode_GetNextSibling(
This->nsnode, &nssibling);
1007 nsIDOMNode_Release(nssibling);
1011 *
p = &
node->IHTMLDOMNode_iface;
1067 return IHTMLDOMNode_QueryInterface(&
This->IHTMLDOMNode_iface,
riid,
ppv);
1074 return IHTMLDOMNode_AddRef(&
This->IHTMLDOMNode_iface);
1081 return IHTMLDOMNode_Release(&
This->IHTMLDOMNode_iface);
1087 return IDispatchEx_GetTypeInfoCount(&
This->event_target.dispex.IDispatchEx_iface, pctinfo);
1094 return IDispatchEx_GetTypeInfo(&
This->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1102 return IDispatchEx_GetIDsOfNames(&
This->event_target.dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
1108 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
1111 return IDispatchEx_Invoke(&
This->event_target.dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
1112 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1126 IDispatch_AddRef(*
p);
1147 *
ppv = &
This->IHTMLDOMNode_iface;
1149 *
ppv = &
This->IHTMLDOMNode_iface;
1151 *
ppv = &
This->IHTMLDOMNode_iface;
1153 *
ppv = &
This->IHTMLDOMNode2_iface;
1158 *
ppv = &
This->IHTMLDOMNode_iface;
1175 nsIDOMNode_Release(
This->nsnode);
1178 if(
This->event_target.ptr)
1203 ccref_init(&
node->ccref, 1);
1209 nsIDOMNode_AddRef(nsnode);
1210 node->nsnode = nsnode;
1212 nsres = nsIDOMNode_SetMshtmlNode(nsnode, (
nsISupports*)&
node->IHTMLDOMNode_iface);
1221 nsIDOMNode_GetNodeType(nsnode, &node_type);
1224 case ELEMENT_NODE: {
1238 case DOCUMENT_TYPE_NODE:
1239 case COMMENT_NODE: {
1247 case ATTRIBUTE_NODE:
1248 ERR(
"Called on attribute node\n");
1263 TRACE(
"type %d ret %p\n", node_type, *
ret);
1273 describe_cc_node(&
This->ccref,
"HTMLDOMNode",
cb);
1278 note_cc_edge((
nsISupports*)&
This->doc->node.IHTMLDOMNode_iface,
"This->doc",
cb);
1281 if(
This->vtbl->traverse)
1293 if(
This->vtbl->unlink)
1301 nsIDOMNode_Release(nsnode);
1321 if(
This->vtbl->unlink)
1336 ccp_init(&
node_ccp, &node_ccp_callback);
1344 nsres = nsIDOMNode_GetMshtmlNode(nsnode, &unk);
1349 nsISupports_Release(unk);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
const char * debugstr_mshtml_guid(const GUID *iid)
GLuint GLuint GLsizei GLenum type
GLenum const GLfloat * params
GLuint GLsizei GLsizei * length
HRESULT HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic, HTMLElement **ret)
void release_event_target(event_target_t *event_target)
static HRESULT WINAPI HTMLDOMNode2_GetIDsOfNames(IHTMLDOMNode2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static ULONG WINAPI HTMLDOMChildrenCollectionEnum_AddRef(IEnumVARIANT *iface)
static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Reset(IEnumVARIANT *iface)
static HRESULT WINAPI HTMLDOMNode2_QueryInterface(IHTMLDOMNode2 *iface, REFIID riid, void **ppv)
static HRESULT create_node(HTMLDocumentNode *, nsIDOMNode *, HTMLDOMNode **)
static ULONG get_enum_len(HTMLDOMChildrenCollectionEnum *This)
static HRESULT HTMLDOMNode_clone(HTMLDOMNode *This, nsIDOMNode *nsnode, HTMLDOMNode **ret)
static HTMLDOMNode * impl_from_IHTMLDOMNode(IHTMLDOMNode *iface)
static HRESULT WINAPI HTMLDOMNode_hasChildNodes(IHTMLDOMNode *iface, VARIANT_BOOL *fChildren)
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
static HRESULT WINAPI HTMLDOMNode_get_nodeName(IHTMLDOMNode *iface, BSTR *p)
static ULONG WINAPI HTMLDOMNode2_AddRef(IHTMLDOMNode2 *iface)
static HRESULT HTMLDOMChildrenCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
static HRESULT WINAPI HTMLDOMNode_GetTypeInfo(IHTMLDOMNode *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
HRESULT HTMLDOMNode_QI(HTMLDOMNode *This, REFIID riid, void **ppv)
static HRESULT WINAPI HTMLDOMChildrenCollection_get__newEnum(IHTMLDOMChildrenCollection *iface, IUnknown **p)
static HRESULT WINAPI HTMLDOMNode_swapNode(IHTMLDOMNode *iface, IHTMLDOMNode *otherNode, IHTMLDOMNode **swappedNode)
static HTMLDOMChildrenCollection * impl_from_IHTMLDOMChildrenCollection(IHTMLDOMChildrenCollection *iface)
static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode *newChild, IHTMLDOMNode **node)
static nsresult NSAPI HTMLDOMNode_traverse(void *ccp, void *p, nsCycleCollectionTraversalCallback *cb)
static ULONG WINAPI HTMLDOMChildrenCollectionEnum_Release(IEnumVARIANT *iface)
void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsnode)
static HRESULT WINAPI HTMLDOMNode_GetTypeInfoCount(IHTMLDOMNode *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLDOMChildrenCollection_get_length(IHTMLDOMChildrenCollection *iface, LONG *p)
static HTMLDOMNode * get_node_obj(IHTMLDOMNode *)
static HRESULT WINAPI HTMLDOMChildrenCollection_item(IHTMLDOMChildrenCollection *iface, LONG index, IDispatch **ppItem)
static HRESULT WINAPI HTMLDOMNode_get_firstChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
static const IEnumVARIANTVtbl HTMLDOMChildrenCollectionEnumVtbl
static HRESULT WINAPI HTMLDOMChildrenCollection_GetTypeInfo(IHTMLDOMChildrenCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static HRESULT WINAPI HTMLDOMNode_replaceChild(IHTMLDOMNode *iface, IHTMLDOMNode *newChild, IHTMLDOMNode *oldChild, IHTMLDOMNode **node)
static HRESULT WINAPI HTMLDOMNode_QueryInterface(IHTMLDOMNode *iface, REFIID riid, void **ppv)
static ExternalCycleCollectionParticipant node_ccp
static HRESULT WINAPI HTMLDOMNode2_Invoke(IHTMLDOMNode2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static IHTMLDOMChildrenCollection * create_child_collection(HTMLDocumentNode *doc, nsIDOMNodeList *nslist)
static const tid_t HTMLDOMChildrenCollection_iface_tids[]
void HTMLDOMNode_destructor(HTMLDOMNode *This)
static ULONG WINAPI HTMLDOMNode2_Release(IHTMLDOMNode2 *iface)
static ULONG WINAPI HTMLDOMNode_AddRef(IHTMLDOMNode *iface)
static HTMLDOMChildrenCollection * impl_from_DispatchEx(DispatchEx *iface)
#define DISPID_CHILDCOL_0
static HRESULT WINAPI HTMLDOMNode2_GetTypeInfo(IHTMLDOMNode2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static const dispex_static_data_vtbl_t HTMLDOMChildrenCollection_dispex_vtbl
static HRESULT WINAPI HTMLDOMNode2_GetTypeInfoCount(IHTMLDOMNode2 *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLDOMChildrenCollection_Invoke(IHTMLDOMChildrenCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT HTMLDOMChildrenCollection_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
static HRESULT WINAPI HTMLDOMNode_Invoke(IHTMLDOMNode *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI HTMLDOMNode_get_nodeValue(IHTMLDOMNode *iface, VARIANT *p)
static HRESULT WINAPI HTMLDOMChildrenCollection_QueryInterface(IHTMLDOMChildrenCollection *iface, REFIID riid, void **ppv)
static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
static ULONG WINAPI HTMLDOMChildrenCollection_Release(IHTMLDOMChildrenCollection *iface)
static HRESULT WINAPI HTMLDOMNode_get_nextSibling(IHTMLDOMNode *iface, IHTMLDOMNode **p)
static HRESULT WINAPI HTMLDOMNode_removeChild(IHTMLDOMNode *iface, IHTMLDOMNode *oldChild, IHTMLDOMNode **node)
static const cpc_entry_t HTMLDOMNode_cpc[]
static nsresult NSAPI HTMLDOMNode_unlink(void *p)
static dispex_static_data_t HTMLDOMChildrenCollection_dispex
static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
static HRESULT WINAPI HTMLDOMNode_removeNode(IHTMLDOMNode *iface, VARIANT_BOOL fDeep, IHTMLDOMNode **removed)
static const IHTMLDOMChildrenCollectionVtbl HTMLDOMChildrenCollectionVtbl
static ULONG WINAPI HTMLDOMChildrenCollection_AddRef(IHTMLDOMChildrenCollection *iface)
static HRESULT WINAPI HTMLDOMChildrenCollection_GetTypeInfoCount(IHTMLDOMChildrenCollection *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLDOMChildrenCollection_GetIDsOfNames(IHTMLDOMChildrenCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI HTMLDOMNode_put_nodeValue(IHTMLDOMNode *iface, VARIANT v)
static HRESULT WINAPI HTMLDOMNode_get_lastChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
static void NSAPI HTMLDOMNode_delete_cycle_collectable(void *p)
static HRESULT WINAPI HTMLDOMNode_replaceNode(IHTMLDOMNode *iface, IHTMLDOMNode *replacement, IHTMLDOMNode **replaced)
static HRESULT WINAPI HTMLDOMNode2_get_ownerDocument(IHTMLDOMNode2 *iface, IDispatch **p)
static HRESULT WINAPI HTMLDOMNode_get_previousSibling(IHTMLDOMNode *iface, IHTMLDOMNode **p)
static const IHTMLDOMNode2Vtbl HTMLDOMNode2Vtbl
static HTMLDOMChildrenCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
static ULONG WINAPI HTMLDOMNode_Release(IHTMLDOMNode *iface)
static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode *newChild, VARIANT refChild, IHTMLDOMNode **node)
static HRESULT WINAPI HTMLDOMNode_get_childNodes(IHTMLDOMNode *iface, IDispatch **p)
static HRESULT WINAPI HTMLDOMNode_get_nodeType(IHTMLDOMNode *iface, LONG *p)
static HRESULT WINAPI HTMLDOMNode_GetIDsOfNames(IHTMLDOMNode *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI HTMLDOMNode_get_parentNode(IHTMLDOMNode *iface, IHTMLDOMNode **p)
static const IHTMLDOMNodeVtbl HTMLDOMNodeVtbl
static HRESULT WINAPI HTMLDOMNode_cloneNode(IHTMLDOMNode *iface, VARIANT_BOOL fDeep, IHTMLDOMNode **clonedNode)
static HTMLDOMNode * impl_from_IHTMLDOMNode2(IHTMLDOMNode2 *iface)
static HRESULT WINAPI HTMLDOMNode_get_attributes(IHTMLDOMNode *iface, IDispatch **p)
static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt)
static const NodeImplVtbl HTMLDOMNodeImplVtbl
HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNode **node)
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
#define comment(fmt, arg1)
static const char * debugstr_variant(const VARIANT *var)
static HMODULE MODULEINFO DWORD cb
static const struct access_res create[16]
static VARIANTARG static DISPID
void release_dispex(DispatchEx *This)
void dispex_traverse(DispatchEx *This, nsCycleCollectionTraversalCallback *cb)
void dispex_unlink(DispatchEx *This)
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
static void node_addref(HTMLDOMNode *node)
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
static void node_release(HTMLDOMNode *node)
static ULONG htmldoc_addref(HTMLDocument *This)
struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
static ULONG htmldoc_release(HTMLDocument *This)
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
BSTR WINAPI SysAllocString(LPCOLESTR str)
#define DISPATCH_PROPERTYGET
#define IsEqualGUID(rguid1, rguid2)
IHTMLAttributeCollection IHTMLAttributeCollection_iface
IEnumVARIANT IEnumVARIANT_iface
HTMLDOMChildrenCollection * col
IHTMLDOMChildrenCollection IHTMLDOMChildrenCollection_iface
IHTMLDOMNode IHTMLDOMNode_iface
#define CONTAINING_RECORD(address, type, field)
_In_ DWORD _Out_ _In_ WORD wFlags
#define DISP_E_UNKNOWNNAME