56 if(
buf->len ==
buf->size) {
69 }
else if(
buf->size >
buf->len) {
82 return type == ELEMENT_NODE ||
type == COMMENT_NODE;
97 *
ppv = &
This->IEnumVARIANT_iface;
99 *
ppv = &
This->IEnumVARIANT_iface;
128 IHTMLElementCollection_Release(&
This->col->IHTMLElementCollection_iface);
140 TRACE(
"(%p)->(%d %p %p)\n",
This, celt, rgVar, pCeltFetched);
142 while(
This->iter+fetched < This->col->len && fetched < celt) {
149 This->iter += fetched;
151 *pCeltFetched = fetched;
161 if(
This->iter + celt >
This->col->len) {
210 *
ppv = &
This->IHTMLElementCollection_iface;
212 *
ppv = &
This->IHTMLElementCollection_iface;
221 IHTMLElementCollection_AddRef(&
This->IHTMLElementCollection_iface);
260 return IDispatchEx_GetTypeInfoCount(&
This->dispex.IDispatchEx_iface, pctinfo);
267 return IDispatchEx_GetTypeInfo(&
This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
274 return IDispatchEx_GetIDsOfNames(&
This->dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
280 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
283 return IDispatchEx_Invoke(&
This->dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
284 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
330 IHTMLElementCollection_AddRef(&
This->IHTMLElementCollection_iface);
342 hres = IHTMLElement_get_id(&
elem->IHTMLElement_iface, &elem_id);
344 WARN(
"IHTMLElement_get_id failed: 0x%08x\n",
hres);
370 nsIDOMHTMLElement_GetId(
elem->nselem, &nsstr);
388 if(idx < This->
len) {
390 IDispatch_AddRef(*
ret);
435 IDispatch_AddRef(*pdisp);
470 TRACE(
"returning %p\n", *pdisp);
484 WARN(
"Invalid arg\n");
495 if(!
This->elems[
i]->nselem)
498 nsIDOMHTMLElement_GetTagName(
This->elems[
i]->nselem, &tag_str);
538#define DISPID_ELEMCOL_0 MSHTML_DISPID_CUSTOM_MIN
565 TRACE(
"ret %x\n", *dispid);
585 IHTMLElement_AddRef(&
This->elems[
idx]->IHTMLElement_iface);
603 IHTMLElementCollection_tid,
609 DispHTMLElementCollection_tid,
622 nsres = nsIDOMNode_GetChildNodes(
elem->nsnode, &nsnode_list);
624 ERR(
"GetChildNodes failed: %08x\n", nsres);
628 nsIDOMNodeList_GetLength(nsnode_list, &list_len);
632 for(
i=0;
i<list_len;
i++) {
633 nsres = nsIDOMNodeList_Item(nsnode_list,
i, &iter);
635 ERR(
"Item failed: %08x\n", nsres);
677 nsIDOMNodeList_GetLength(nslist, &
length);
687 nsIDOMNodeList_Item(nslist,
i, &nsnode);
694 nsIDOMNode_Release(nsnode);
712 nsIDOMHTMLCollection_GetLength(nscol, &
length);
721 nsIDOMHTMLCollection_Item(nscol,
i, &nsnode);
723 nsIDOMNode_Release(nsnode);
750 iter =
elem->node.nsnode;
751 nsIDOMNode_AddRef(iter);
755 nsres = nsIDOMNode_GetParentNode(iter, &parent_node);
756 nsIDOMNode_Release(iter);
761 nsres = nsIDOMNode_GetNodeType(parent_node, &parent_type);
764 if(parent_type != ELEMENT_NODE) {
765 if(parent_type != DOCUMENT_NODE && parent_type != DOCUMENT_FRAGMENT_NODE)
766 FIXME(
"Unexpected parent_type %d\n", parent_type);
779 nsIDOMNode_Release(parent_node);
788 IHTMLDOMNode_Release(&
node->IHTMLDOMNode_iface);
794 for(
i=0;
i <
buf.len;
i++) {
798 IHTMLDOMNode_Release(&
node->IHTMLDOMNode_iface);
801 FIXME(
"The element is not in parent's child list?\n");
826 return &
ret->IHTMLElementCollection_iface;
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define InterlockedIncrement
#define InterlockedDecrement
static const WCHAR nameW[]
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
const char * debugstr_mshtml_guid(const GUID *iid)
GLuint GLuint GLsizei GLenum type
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
static HRESULT WINAPI HTMLElementCollectionEnum_Reset(IEnumVARIANT *iface)
static ULONG WINAPI HTMLElementCollectionEnum_AddRef(IEnumVARIANT *iface)
static BOOL is_elem_node(nsIDOMNode *node)
static dispex_static_data_t HTMLElementCollection_dispex
static HRESULT WINAPI HTMLElementCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl
static HRESULT WINAPI HTMLElementCollection_get__newEnum(IHTMLElementCollection *iface, IUnknown **p)
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
static HTMLElementCollection * impl_from_DispatchEx(DispatchEx *iface)
static HRESULT WINAPI HTMLElementCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames(IHTMLElementCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static const tid_t HTMLElementCollection_iface_tids[]
HRESULT get_elem_source_index(HTMLElement *elem, LONG *ret)
IHTMLElementCollection * create_all_collection(HTMLDOMNode *node, BOOL include_root)
static HRESULT WINAPI HTMLElementCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt)
static HRESULT WINAPI HTMLElementCollection_GetTypeInfo(IHTMLElementCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface, VARIANT name, VARIANT index, IDispatch **pdisp)
static HTMLElement * elem_from_HTMLDOMNode(HTMLDOMNode *iface)
static HRESULT get_item_idx(HTMLElementCollection *This, UINT idx, IDispatch **ret)
static BOOL is_elem_id(HTMLElement *elem, LPCWSTR name)
static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf)
static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, VARIANT tagName, IDispatch **pdisp)
static HRESULT WINAPI HTMLElementCollection_Invoke(IHTMLElementCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT HTMLElementCollection_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
static ULONG WINAPI HTMLElementCollectionEnum_Release(IEnumVARIANT *iface)
static HRESULT WINAPI HTMLElementCollection_toString(IHTMLElementCollection *iface, BSTR *String)
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
static HRESULT WINAPI HTMLElementCollection_get_length(IHTMLElementCollection *iface, LONG *p)
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
IHTMLElementCollection * create_collection_from_nodelist(HTMLDocumentNode *doc, nsIDOMNodeList *nslist)
static const IEnumVARIANTVtbl HTMLElementCollectionEnumVtbl
static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface, REFIID riid, void **ppv)
static HRESULT HTMLElementCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
static void elem_vector_normalize(elem_vector_t *buf)
static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount(IHTMLElementCollection *iface, UINT *pctinfo)
IHTMLElementCollection * create_collection_from_htmlcol(HTMLDocumentNode *doc, nsIDOMHTMLCollection *nscol)
static HRESULT WINAPI HTMLElementCollection_put_length(IHTMLElementCollection *iface, LONG v)
static HRESULT WINAPI HTMLElementCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface)
static ULONG WINAPI HTMLElementCollection_AddRef(IHTMLElementCollection *iface)
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
static const char * debugstr_variant(const VARIANT *var)
static VARIANTARG static DISPID
void release_dispex(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)
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
static void node_release(HTMLDOMNode *node)
#define NS_SUCCEEDED(res)
#define LOCALE_SYSTEM_DEFAULT
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define DISPATCH_PROPERTYGET
#define IsEqualGUID(rguid1, rguid2)
HTMLElementCollection * col
IEnumVARIANT IEnumVARIANT_iface
IHTMLElementCollection IHTMLElementCollection_iface
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ DWORD _Out_ _In_ WORD wFlags
#define DISP_E_MEMBERNOTFOUND
#define DISP_E_UNKNOWNNAME