ReactOS  0.4.13-dev-99-g7e18b6d
htmlelemcol.c File Reference
#include "mshtml_private.h"
Include dependency graph for htmlelemcol.c:

Go to the source code of this file.

Classes

struct  HTMLElementCollection
 
struct  HTMLElementCollectionEnum
 
struct  elem_vector_t
 

Macros

#define DISPID_ELEMCOL_0   MSHTML_DISPID_CUSTOM_MIN
 

Functions

static HTMLElementelem_from_HTMLDOMNode (HTMLDOMNode *iface)
 
static IHTMLElementCollection * HTMLElementCollection_Create (HTMLElement **elems, DWORD len)
 
static void elem_vector_add (elem_vector_t *buf, HTMLElement *elem)
 
static void elem_vector_normalize (elem_vector_t *buf)
 
static BOOL is_elem_node (nsIDOMNode *node)
 
static HTMLElementCollectionEnumimpl_from_IEnumVARIANT (IEnumVARIANT *iface)
 
static HRESULT WINAPI HTMLElementCollectionEnum_QueryInterface (IEnumVARIANT *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLElementCollectionEnum_AddRef (IEnumVARIANT *iface)
 
static ULONG WINAPI HTMLElementCollectionEnum_Release (IEnumVARIANT *iface)
 
static HRESULT WINAPI HTMLElementCollectionEnum_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
 
static HRESULT WINAPI HTMLElementCollectionEnum_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI HTMLElementCollectionEnum_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI HTMLElementCollectionEnum_Clone (IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
 
static HTMLElementCollectionimpl_from_IHTMLElementCollection (IHTMLElementCollection *iface)
 
static HRESULT WINAPI HTMLElementCollection_QueryInterface (IHTMLElementCollection *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLElementCollection_AddRef (IHTMLElementCollection *iface)
 
static ULONG WINAPI HTMLElementCollection_Release (IHTMLElementCollection *iface)
 
static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount (IHTMLElementCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLElementCollection_GetTypeInfo (IHTMLElementCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames (IHTMLElementCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
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 WINAPI HTMLElementCollection_toString (IHTMLElementCollection *iface, BSTR *String)
 
static HRESULT WINAPI HTMLElementCollection_put_length (IHTMLElementCollection *iface, LONG v)
 
static HRESULT WINAPI HTMLElementCollection_get_length (IHTMLElementCollection *iface, LONG *p)
 
static HRESULT WINAPI HTMLElementCollection_get__newEnum (IHTMLElementCollection *iface, IUnknown **p)
 
static BOOL is_elem_id (HTMLElement *elem, LPCWSTR name)
 
static BOOL is_elem_name (HTMLElement *elem, LPCWSTR name)
 
static HRESULT get_item_idx (HTMLElementCollection *This, UINT idx, IDispatch **ret)
 
static HRESULT WINAPI HTMLElementCollection_item (IHTMLElementCollection *iface, VARIANT name, VARIANT index, IDispatch **pdisp)
 
static HRESULT WINAPI HTMLElementCollection_tags (IHTMLElementCollection *iface, VARIANT tagName, IDispatch **pdisp)
 
static HTMLElementCollectionimpl_from_DispatchEx (DispatchEx *iface)
 
static HRESULT HTMLElementCollection_get_dispid (DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
 
static HRESULT HTMLElementCollection_invoke (DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
 
static void create_all_list (HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf)
 
IHTMLElementCollection * create_all_collection (HTMLDOMNode *node, BOOL include_root)
 
IHTMLElementCollection * create_collection_from_nodelist (HTMLDocumentNode *doc, nsIDOMNodeList *nslist)
 
IHTMLElementCollection * create_collection_from_htmlcol (HTMLDocumentNode *doc, nsIDOMHTMLCollection *nscol)
 
HRESULT get_elem_source_index (HTMLElement *elem, LONG *ret)
 

Variables

static const IEnumVARIANTVtbl HTMLElementCollectionEnumVtbl
 
static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl
 
static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl
 
static const tid_t HTMLElementCollection_iface_tids []
 
static dispex_static_data_t HTMLElementCollection_dispex
 

Macro Definition Documentation

◆ DISPID_ELEMCOL_0

#define DISPID_ELEMCOL_0   MSHTML_DISPID_CUSTOM_MIN

Definition at line 538 of file htmlelemcol.c.

Function Documentation

◆ create_all_collection()

IHTMLElementCollection* create_all_collection ( HTMLDOMNode node,
BOOL  include_root 
)

Definition at line 654 of file htmlelemcol.c.

655 {
656  elem_vector_t buf = {NULL, 0, 8};
657 
658  buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
659 
660  if(include_root) {
661  node_addref(node);
663  }
664  create_all_list(node->doc, node, &buf);
666 
667  return HTMLElementCollection_Create(buf.buf, buf.len);
668 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf)
Definition: htmlelemcol.c:614
static void node_addref(HTMLDOMNode *node)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static void elem_vector_normalize(elem_vector_t *buf)
Definition: htmlelemcol.c:64
smooth NULL
Definition: ftsmooth.c:416
static HTMLElement * elem_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlelemcol.c:47
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
Definition: htmlelemcol.c:54
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
Definition: htmlelemcol.c:809
Definition: dlist.c:348

Referenced by HTMLDocument_get_all(), and HTMLElement_get_all().

◆ create_all_list()

static void create_all_list ( HTMLDocumentNode doc,
HTMLDOMNode elem,
elem_vector_t buf 
)
static

Definition at line 614 of file htmlelemcol.c.

615 {
616  nsIDOMNodeList *nsnode_list;
617  nsIDOMNode *iter;
618  UINT32 list_len = 0, i;
619  nsresult nsres;
620  HRESULT hres;
621 
622  nsres = nsIDOMNode_GetChildNodes(elem->nsnode, &nsnode_list);
623  if(NS_FAILED(nsres)) {
624  ERR("GetChildNodes failed: %08x\n", nsres);
625  return;
626  }
627 
628  nsIDOMNodeList_GetLength(nsnode_list, &list_len);
629  if(!list_len)
630  return;
631 
632  for(i=0; i<list_len; i++) {
633  nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter);
634  if(NS_FAILED(nsres)) {
635  ERR("Item failed: %08x\n", nsres);
636  continue;
637  }
638 
639  if(is_elem_node(iter)) {
640  HTMLDOMNode *node;
641 
642  hres = get_node(doc, iter, TRUE, &node);
643  if(FAILED(hres)) {
644  FIXME("get_node failed: %08x\n", hres);
645  continue;
646  }
647 
649  create_all_list(doc, node, buf);
650  }
651  }
652 }
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf)
Definition: htmlelemcol.c:614
struct node node
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
Definition: glfuncs.h:248
unsigned int UINT32
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
#define NS_FAILED(res)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static HTMLElement * elem_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlelemcol.c:47
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
Definition: htmlelemcol.c:54
static BOOL is_elem_node(nsIDOMNode *node)
Definition: htmlelemcol.c:76
#define ERR(fmt,...)
Definition: debug.h:109
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
HRESULT nsresult
Definition: nsiface.idl:39
Definition: dlist.c:348

Referenced by create_all_collection(), and get_elem_source_index().

◆ create_collection_from_htmlcol()

IHTMLElementCollection* create_collection_from_htmlcol ( HTMLDocumentNode doc,
nsIDOMHTMLCollection nscol 
)

Definition at line 705 of file htmlelemcol.c.

706 {
707  UINT32 length = 0, i;
709  HTMLDOMNode *node;
710  HRESULT hres = S_OK;
711 
712  nsIDOMHTMLCollection_GetLength(nscol, &length);
713 
714  buf.len = buf.size = length;
715  if(buf.len) {
716  nsIDOMNode *nsnode;
717 
718  buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
719 
720  for(i=0; i<length; i++) {
721  nsIDOMHTMLCollection_Item(nscol, i, &nsnode);
722  hres = get_node(doc, nsnode, TRUE, &node);
723  nsIDOMNode_Release(nsnode);
724  if(FAILED(hres))
725  break;
727  }
728  }else {
729  buf.buf = NULL;
730  }
731 
732  if(FAILED(hres)) {
733  heap_free(buf.buf);
734  return NULL;
735  }
736 
737  return HTMLElementCollection_Create(buf.buf, buf.len);
738 }
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct node node
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
Definition: glfuncs.h:248
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static HTMLElement * elem_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlelemcol.c:47
#define S_OK
Definition: intsafe.h:59
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
Definition: htmlelemcol.c:809
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: dlist.c:348

Referenced by HTMLDocument_get_anchors(), HTMLDocument_get_applets(), HTMLDocument_get_forms(), HTMLDocument_get_images(), HTMLDocument_get_links(), HTMLDocument_get_scripts(), HTMLElement2_getElementsByTagName(), HTMLTable_get_rows(), HTMLTable_get_tBodies(), and HTMLTableRow_get_cells().

◆ create_collection_from_nodelist()

IHTMLElementCollection* create_collection_from_nodelist ( HTMLDocumentNode doc,
nsIDOMNodeList nslist 
)

Definition at line 670 of file htmlelemcol.c.

671 {
672  UINT32 length = 0, i;
673  HTMLDOMNode *node;
675  HRESULT hres;
676 
677  nsIDOMNodeList_GetLength(nslist, &length);
678 
679  buf.len = 0;
680  buf.size = length;
681  if(length) {
682  nsIDOMNode *nsnode;
683 
684  buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
685 
686  for(i=0; i<length; i++) {
687  nsIDOMNodeList_Item(nslist, i, &nsnode);
688  if(is_elem_node(nsnode)) {
689  hres = get_node(doc, nsnode, TRUE, &node);
690  if(FAILED(hres))
691  continue;
692  buf.buf[buf.len++] = elem_from_HTMLDOMNode(node);
693  }
694  nsIDOMNode_Release(nsnode);
695  }
696 
698  }else {
699  buf.buf = NULL;
700  }
701 
702  return HTMLElementCollection_Create(buf.buf, buf.len);
703 }
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct node node
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
Definition: glfuncs.h:248
unsigned int UINT32
static void elem_vector_normalize(elem_vector_t *buf)
Definition: htmlelemcol.c:64
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static HTMLElement * elem_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlelemcol.c:47
static BOOL is_elem_node(nsIDOMNode *node)
Definition: htmlelemcol.c:76
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
Definition: htmlelemcol.c:809
Definition: dlist.c:348

Referenced by HTMLDocument3_getElementsByName(), HTMLDocument3_getElementsByTagName(), and HTMLElement_get_children().

◆ elem_from_HTMLDOMNode()

static HTMLElement* elem_from_HTMLDOMNode ( HTMLDOMNode iface)
inlinestatic

Definition at line 47 of file htmlelemcol.c.

48 {
49  return CONTAINING_RECORD(iface, HTMLElement, node);
50 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: dlist.c:348

Referenced by create_all_collection(), create_all_list(), create_collection_from_htmlcol(), and create_collection_from_nodelist().

◆ elem_vector_add()

static void elem_vector_add ( elem_vector_t buf,
HTMLElement elem 
)
static

Definition at line 54 of file htmlelemcol.c.

55 {
56  if(buf->len == buf->size) {
57  buf->size <<= 1;
58  buf->buf = heap_realloc(buf->buf, buf->size*sizeof(HTMLElement*));
59  }
60 
61  buf->buf[buf->len++] = elem;
62 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static size_t elem
Definition: string.c:68

Referenced by create_all_collection(), create_all_list(), HTMLElementCollection_item(), and HTMLElementCollection_tags().

◆ elem_vector_normalize()

static void elem_vector_normalize ( elem_vector_t buf)
static

Definition at line 64 of file htmlelemcol.c.

65 {
66  if(!buf->len) {
67  heap_free(buf->buf);
68  buf->buf = NULL;
69  }else if(buf->size > buf->len) {
70  buf->buf = heap_realloc(buf->buf, buf->len*sizeof(HTMLElement*));
71  }
72 
73  buf->size = buf->len;
74 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
smooth NULL
Definition: ftsmooth.c:416
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by create_all_collection(), create_collection_from_nodelist(), HTMLElementCollection_item(), and HTMLElementCollection_tags().

◆ get_elem_source_index()

HRESULT get_elem_source_index ( HTMLElement elem,
LONG ret 
)

Definition at line 740 of file htmlelemcol.c.

741 {
742  elem_vector_t buf = {NULL, 0, 8};
743  nsIDOMNode *parent_node, *iter;
744  UINT16 parent_type;
745  HTMLDOMNode *node;
746  int i;
747  nsresult nsres;
748  HRESULT hres;
749 
750  iter = elem->node.nsnode;
751  nsIDOMNode_AddRef(iter);
752 
753  /* Find document or document fragment parent. */
754  while(1) {
755  nsres = nsIDOMNode_GetParentNode(iter, &parent_node);
756  nsIDOMNode_Release(iter);
757  assert(nsres == NS_OK);
758  if(!parent_node)
759  break;
760 
761  nsres = nsIDOMNode_GetNodeType(parent_node, &parent_type);
762  assert(nsres == NS_OK);
763 
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);
767  break;
768  }
769 
770  iter = parent_node;
771  }
772 
773  if(!parent_node) {
774  *ret = -1;
775  return S_OK;
776  }
777 
778  hres = get_node(elem->node.doc, parent_node, TRUE, &node);
779  nsIDOMNode_Release(parent_node);
780  if(FAILED(hres))
781  return hres;
782 
783 
784  /* Create all children collection and find the element in it.
785  * This could be optimized if we ever find the reason. */
786  buf.buf = heap_alloc(buf.size*sizeof(*buf.buf));
787  if(!buf.buf) {
788  IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface);
789  return E_OUTOFMEMORY;
790  }
791 
792  create_all_list(elem->node.doc, node, &buf);
793 
794  for(i=0; i < buf.len; i++) {
795  if(buf.buf[i] == elem)
796  break;
797  }
798  IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface);
799  heap_free(buf.buf);
800  if(i == buf.len) {
801  FIXME("The element is not in parent's child list?\n");
802  return E_UNEXPECTED;
803  }
804 
805  *ret = i;
806  return S_OK;
807 }
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define assert(x)
Definition: debug.h:53
static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vector_t *buf)
Definition: htmlelemcol.c:614
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define NS_OK
struct node node
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
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static size_t elem
Definition: string.c:68
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
unsigned short UINT16
#define E_UNEXPECTED
Definition: winerror.h:2456
HRESULT nsresult
Definition: nsiface.idl:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: dlist.c:348

Referenced by HTMLElement_get_sourceIndex().

◆ get_item_idx()

static HRESULT get_item_idx ( HTMLElementCollection This,
UINT  idx,
IDispatch **  ret 
)
static

Definition at line 386 of file htmlelemcol.c.

387 {
388  if(idx < This->len) {
389  *ret = (IDispatch*)This->elems[idx];
390  IDispatch_AddRef(*ret);
391  }
392 
393  return S_OK;
394 }
unsigned int idx
Definition: utils.c:41
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59

Referenced by HTMLElementCollection_item().

◆ HTMLElementCollection_AddRef()

static ULONG WINAPI HTMLElementCollection_AddRef ( IHTMLElementCollection *  iface)
static

Definition at line 225 of file htmlelemcol.c.

226 {
229 
230  TRACE("(%p) ref=%d\n", This, ref);
231 
232  return ref;
233 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ HTMLElementCollection_Create()

static IHTMLElementCollection * HTMLElementCollection_Create ( HTMLElement **  elems,
DWORD  len 
)
static

Definition at line 809 of file htmlelemcol.c.

810 {
811  HTMLElementCollection *ret = heap_alloc_zero(sizeof(HTMLElementCollection));
812 
813  if (!ret)
814  return NULL;
815 
816  ret->IHTMLElementCollection_iface.lpVtbl = &HTMLElementCollectionVtbl;
817  ret->ref = 1;
818  ret->elems = elems;
819  ret->len = len;
820 
821  init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLElementCollection_iface,
823 
824  TRACE("ret=%p len=%d\n", ret, len);
825 
826  return &ret->IHTMLElementCollection_iface;
827 }
static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl
Definition: htmlelemcol.c:517
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
GLenum GLsizei len
Definition: glext.h:6722
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:940
static dispex_static_data_t HTMLElementCollection_dispex
Definition: htmlelemcol.c:607

Referenced by create_all_collection(), create_collection_from_htmlcol(), create_collection_from_nodelist(), HTMLElementCollection_item(), and HTMLElementCollection_tags().

◆ HTMLElementCollection_get__newEnum()

static HRESULT WINAPI HTMLElementCollection_get__newEnum ( IHTMLElementCollection *  iface,
IUnknown **  p 
)
static

Definition at line 314 of file htmlelemcol.c.

316 {
319 
320  TRACE("(%p)->(%p)\n", This, p);
321 
322  ret = heap_alloc(sizeof(*ret));
323  if(!ret)
324  return E_OUTOFMEMORY;
325 
326  ret->IEnumVARIANT_iface.lpVtbl = &HTMLElementCollectionEnumVtbl;
327  ret->ref = 1;
328  ret->iter = 0;
329 
330  IHTMLElementCollection_AddRef(&This->IHTMLElementCollection_iface);
331  ret->col = This;
332 
333  *p = (IUnknown*)&ret->IEnumVARIANT_iface;
334  return S_OK;
335 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
int ret
static const IEnumVARIANTVtbl HTMLElementCollectionEnumVtbl
Definition: htmlelemcol.c:187
#define S_OK
Definition: intsafe.h:59
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLElementCollection_get_dispid()

static HRESULT HTMLElementCollection_get_dispid ( DispatchEx dispex,
BSTR  name,
DWORD  flags,
DISPID dispid 
)
static

Definition at line 540 of file htmlelemcol.c.

541 {
543  WCHAR *ptr;
544  DWORD idx=0;
545 
546  if(!*name)
547  return DISP_E_UNKNOWNNAME;
548 
549  for(ptr = name; *ptr && isdigitW(*ptr); ptr++)
550  idx = idx*10 + (*ptr-'0');
551 
552  if(*ptr) {
553  /* the name contains alpha characters, so search by name & id */
554  for(idx = 0; idx < This->len; ++idx) {
555  if(is_elem_id(This->elems[idx], name) ||
556  is_elem_name(This->elems[idx], name))
557  break;
558  }
559  }
560 
561  if(idx >= This->len)
562  return DISP_E_UNKNOWNNAME;
563 
564  *dispid = DISPID_ELEMCOL_0 + idx;
565  TRACE("ret %x\n", *dispid);
566  return S_OK;
567 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static HTMLElementCollection * impl_from_DispatchEx(DispatchEx *iface)
Definition: htmlelemcol.c:533
#define DISPID_ELEMCOL_0
Definition: htmlelemcol.c:538
static BOOL is_elem_id(HTMLElement *elem, LPCWSTR name)
Definition: htmlelemcol.c:337
static PVOID ptr
Definition: dispmode.c:27
unsigned int idx
Definition: utils.c:41
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
Definition: htmlelemcol.c:357
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE int isdigitW(WCHAR wc)
Definition: unicode.h:170
Definition: name.c:36

◆ HTMLElementCollection_get_length()

static HRESULT WINAPI HTMLElementCollection_get_length ( IHTMLElementCollection *  iface,
LONG p 
)
static

Definition at line 303 of file htmlelemcol.c.

305 {
307 
308  TRACE("(%p)->(%p)\n", This, p);
309 
310  *p = This->len;
311  return S_OK;
312 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLElementCollection_GetIDsOfNames()

static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames ( IHTMLElementCollection *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 270 of file htmlelemcol.c.

272 {
274  return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
275  lcid, rgDispId);
276 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
REFIID riid
Definition: precomp.h:44

◆ HTMLElementCollection_GetTypeInfo()

static HRESULT WINAPI HTMLElementCollection_GetTypeInfo ( IHTMLElementCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 263 of file htmlelemcol.c.

265 {
267  return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
268 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197

◆ HTMLElementCollection_GetTypeInfoCount()

static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount ( IHTMLElementCollection *  iface,
UINT pctinfo 
)
static

Definition at line 256 of file htmlelemcol.c.

258 {
260  return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
261 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197

◆ HTMLElementCollection_Invoke()

static HRESULT WINAPI HTMLElementCollection_Invoke ( IHTMLElementCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 278 of file htmlelemcol.c.

281 {
283  return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
284  wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
285 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
REFIID riid
Definition: precomp.h:44
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519

◆ HTMLElementCollection_invoke()

static HRESULT HTMLElementCollection_invoke ( DispatchEx dispex,
DISPID  id,
LCID  lcid,
WORD  flags,
DISPPARAMS *  params,
VARIANT res,
EXCEPINFO *  ei,
IServiceProvider caller 
)
static

Definition at line 569 of file htmlelemcol.c.

571 {
573  DWORD idx;
574 
575  TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
576 
577  idx = id - DISPID_ELEMCOL_0;
578  if(idx >= This->len)
579  return DISP_E_UNKNOWNNAME;
580 
581  switch(flags) {
583  V_VT(res) = VT_DISPATCH;
584  V_DISPATCH(res) = (IDispatch*)&This->elems[idx]->IHTMLElement_iface;
585  IHTMLElement_AddRef(&This->elems[idx]->IHTMLElement_iface);
586  break;
587  default:
588  FIXME("unimplemented flags %x\n", flags);
589  return E_NOTIMPL;
590  }
591 
592  return S_OK;
593 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
static HTMLElementCollection * impl_from_DispatchEx(DispatchEx *iface)
Definition: htmlelemcol.c:533
#define DISPID_ELEMCOL_0
Definition: htmlelemcol.c:538
#define V_DISPATCH(A)
Definition: oleauto.h:239
GLenum const GLfloat * params
Definition: glext.h:5645
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned int idx
Definition: utils.c:41
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
GLuint res
Definition: glext.h:9613

◆ HTMLElementCollection_item()

static HRESULT WINAPI HTMLElementCollection_item ( IHTMLElementCollection *  iface,
VARIANT  name,
VARIANT  index,
IDispatch **  pdisp 
)
static

Definition at line 396 of file htmlelemcol.c.

398 {
400  HRESULT hres = S_OK;
401 
402  TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&name), debugstr_variant(&index), pdisp);
403 
404  *pdisp = NULL;
405 
406  switch(V_VT(&name)) {
407  case VT_I4:
408  case VT_INT:
409  if(V_I4(&name) < 0)
410  return E_INVALIDARG;
411  hres = get_item_idx(This, V_I4(&name), pdisp);
412  break;
413 
414  case VT_UI4:
415  case VT_UINT:
416  hres = get_item_idx(This, V_UINT(&name), pdisp);
417  break;
418 
419  case VT_BSTR: {
420  DWORD i;
421 
422  if(V_VT(&index) == VT_I4) {
423  LONG idx = V_I4(&index);
424 
425  if(idx < 0)
426  return E_INVALIDARG;
427 
428  for(i=0; i<This->len; i++) {
429  if(is_elem_name(This->elems[i], V_BSTR(&name)) && !idx--)
430  break;
431  }
432 
433  if(i != This->len) {
434  *pdisp = (IDispatch*)&This->elems[i]->IHTMLElement_iface;
435  IDispatch_AddRef(*pdisp);
436  }
437  }else {
438  elem_vector_t buf = {NULL, 0, 8};
439 
440  buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
441 
442  for(i=0; i<This->len; i++) {
443  if(is_elem_name(This->elems[i], V_BSTR(&name))) {
444  node_addref(&This->elems[i]->node);
445  elem_vector_add(&buf, This->elems[i]);
446  }
447  }
448 
449  if(buf.len > 1) {
451  *pdisp = (IDispatch*)HTMLElementCollection_Create(buf.buf, buf.len);
452  }else {
453  if(buf.len == 1) {
454  /* Already AddRef-ed */
455  *pdisp = (IDispatch*)&buf.buf[0]->IHTMLElement_iface;
456  }
457 
458  heap_free(buf.buf);
459  }
460  }
461  break;
462  }
463 
464  default:
465  FIXME("Unsupported name %s\n", debugstr_variant(&name));
466  hres = E_NOTIMPL;
467  }
468 
469  if(SUCCEEDED(hres))
470  TRACE("returning %p\n", *pdisp);
471  return hres;
472 }
Definition: compat.h:1939
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HRESULT get_item_idx(HTMLElementCollection *This, UINT idx, IDispatch **ret)
Definition: htmlelemcol.c:386
static void node_addref(HTMLDOMNode *node)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define V_I4(A)
Definition: oleauto.h:247
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
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
static void elem_vector_normalize(elem_vector_t *buf)
Definition: htmlelemcol.c:64
unsigned int idx
Definition: utils.c:41
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
Definition: htmlelemcol.c:357
#define V_VT(A)
Definition: oleauto.h:211
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
Definition: htmlelemcol.c:54
#define V_BSTR(A)
Definition: oleauto.h:226
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:36
#define V_UINT(A)
Definition: oleauto.h:264
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
Definition: htmlelemcol.c:809
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HTMLElementCollection_put_length()

static HRESULT WINAPI HTMLElementCollection_put_length ( IHTMLElementCollection *  iface,
LONG  v 
)
static

Definition at line 295 of file htmlelemcol.c.

297 {
299  FIXME("(%p)->(%d)\n", This, v);
300  return E_NOTIMPL;
301 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
#define FIXME(fmt,...)
Definition: debug.h:110
const GLdouble * v
Definition: gl.h:2040
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLElementCollection_QueryInterface()

static HRESULT WINAPI HTMLElementCollection_QueryInterface ( IHTMLElementCollection *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 202 of file htmlelemcol.c.

204 {
206 
207  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
208 
209  if(IsEqualGUID(&IID_IUnknown, riid)) {
210  *ppv = &This->IHTMLElementCollection_iface;
211  }else if(IsEqualGUID(&IID_IHTMLElementCollection, riid)) {
212  *ppv = &This->IHTMLElementCollection_iface;
213  }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
214  return *ppv ? S_OK : E_NOINTERFACE;
215  }else {
216  *ppv = NULL;
217  FIXME("Unsupported iface %s\n", debugstr_mshtml_guid(riid));
218  return E_NOINTERFACE;
219  }
220 
221  IHTMLElementCollection_AddRef(&This->IHTMLElementCollection_iface);
222  return S_OK;
223 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ HTMLElementCollection_Release()

static ULONG WINAPI HTMLElementCollection_Release ( IHTMLElementCollection *  iface)
static

Definition at line 235 of file htmlelemcol.c.

236 {
239 
240  TRACE("(%p) ref=%d\n", This, ref);
241 
242  if(!ref) {
243  unsigned i;
244 
245  for(i=0; i < This->len; i++)
246  node_release(&This->elems[i]->node);
247  heap_free(This->elems);
248 
249  release_dispex(&This->dispex);
250  heap_free(This);
251  }
252 
253  return ref;
254 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
Definition: send.c:47
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
Definition: glfuncs.h:248
static void node_release(HTMLDOMNode *node)
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
void release_dispex(DispatchEx *This)
Definition: dispex.c:1706
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HTMLElementCollection_tags()

static HRESULT WINAPI HTMLElementCollection_tags ( IHTMLElementCollection *  iface,
VARIANT  tagName,
IDispatch **  pdisp 
)
static

Definition at line 474 of file htmlelemcol.c.

476 {
478  DWORD i;
479  nsAString tag_str;
480  const PRUnichar *tag;
481  elem_vector_t buf = {NULL, 0, 8};
482 
483  if(V_VT(&tagName) != VT_BSTR) {
484  WARN("Invalid arg\n");
485  return DISP_E_MEMBERNOTFOUND;
486  }
487 
488  TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp);
489 
490  buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
491 
492  nsAString_Init(&tag_str, NULL);
493 
494  for(i=0; i<This->len; i++) {
495  if(!This->elems[i]->nselem)
496  continue;
497 
498  nsIDOMHTMLElement_GetTagName(This->elems[i]->nselem, &tag_str);
499  nsAString_GetData(&tag_str, &tag);
500 
502  V_BSTR(&tagName), -1) == CSTR_EQUAL) {
503  node_addref(&This->elems[i]->node);
504  elem_vector_add(&buf, This->elems[i]);
505  }
506  }
507 
508  nsAString_Finish(&tag_str);
510 
511  TRACE("fount %d tags\n", buf.len);
512 
513  *pdisp = (IDispatch*)HTMLElementCollection_Create(buf.buf, buf.len);
514  return S_OK;
515 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WARN(fmt,...)
Definition: debug.h:111
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
Definition: ecma_167.h:138
#define NORM_IGNORECASE
Definition: winnls.h:173
static void node_addref(HTMLDOMNode *node)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
static void elem_vector_normalize(elem_vector_t *buf)
Definition: htmlelemcol.c:64
smooth NULL
Definition: ftsmooth.c:416
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: lang.c:2275
#define TRACE(s)
Definition: solgame.cpp:4
#define LOCALE_SYSTEM_DEFAULT
unsigned long DWORD
Definition: ntddk_ex.h:95
#define V_VT(A)
Definition: oleauto.h:211
#define CSTR_EQUAL
Definition: winnls.h:453
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
Definition: htmlelemcol.c:54
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
WCHAR PRUnichar
Definition: nsiface.idl:48
static IHTMLElementCollection * HTMLElementCollection_Create(HTMLElement **elems, DWORD len)
Definition: htmlelemcol.c:809
char * tag
Definition: main.c:59

◆ HTMLElementCollection_toString()

static HRESULT WINAPI HTMLElementCollection_toString ( IHTMLElementCollection *  iface,
BSTR String 
)
static

Definition at line 287 of file htmlelemcol.c.

289 {
291  FIXME("(%p)->(%p)\n", This, String);
292  return E_NOTIMPL;
293 }
static HTMLElementCollection * impl_from_IHTMLElementCollection(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:197
static WCHAR String[]
Definition: stringtable.c:55
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLElementCollectionEnum_AddRef()

static ULONG WINAPI HTMLElementCollectionEnum_AddRef ( IEnumVARIANT iface)
static

Definition at line 110 of file htmlelemcol.c.

111 {
114 
115  TRACE("(%p) ref=%d\n", This, ref);
116 
117  return ref;
118 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85

◆ HTMLElementCollectionEnum_Clone()

static HRESULT WINAPI HTMLElementCollectionEnum_Clone ( IEnumVARIANT iface,
IEnumVARIANT **  ppEnum 
)
static

Definition at line 180 of file htmlelemcol.c.

181 {
183  FIXME("(%p)->(%p)\n", This, ppEnum);
184  return E_NOTIMPL;
185 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85

◆ HTMLElementCollectionEnum_Next()

static HRESULT WINAPI HTMLElementCollectionEnum_Next ( IEnumVARIANT iface,
ULONG  celt,
VARIANT rgVar,
ULONG pCeltFetched 
)
static

Definition at line 135 of file htmlelemcol.c.

136 {
138  ULONG fetched = 0;
139 
140  TRACE("(%p)->(%d %p %p)\n", This, celt, rgVar, pCeltFetched);
141 
142  while(This->iter+fetched < This->col->len && fetched < celt) {
143  V_VT(rgVar+fetched) = VT_DISPATCH;
144  V_DISPATCH(rgVar+fetched) = (IDispatch*)&This->col->elems[This->iter+fetched]->IHTMLElement_iface;
145  IDispatch_AddRef(V_DISPATCH(rgVar+fetched));
146  fetched++;
147  }
148 
149  This->iter += fetched;
150  if(pCeltFetched)
151  *pCeltFetched = fetched;
152  return fetched == celt ? S_OK : S_FALSE;
153 }
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85
unsigned int ULONG
Definition: retypes.h:1

◆ HTMLElementCollectionEnum_QueryInterface()

static HRESULT WINAPI HTMLElementCollectionEnum_QueryInterface ( IEnumVARIANT iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 90 of file htmlelemcol.c.

91 {
93 
94  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
95 
97  *ppv = &This->IEnumVARIANT_iface;
98  }else if(IsEqualGUID(riid, &IID_IEnumVARIANT)) {
99  *ppv = &This->IEnumVARIANT_iface;
100  }else {
101  FIXME("Unsupported iface %s\n", debugstr_mshtml_guid(riid));
102  *ppv = NULL;
103  return E_NOINTERFACE;
104  }
105 
106  IUnknown_AddRef((IUnknown*)*ppv);
107  return S_OK;
108 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85

◆ HTMLElementCollectionEnum_Release()

static ULONG WINAPI HTMLElementCollectionEnum_Release ( IEnumVARIANT iface)
static

Definition at line 120 of file htmlelemcol.c.

121 {
124 
125  TRACE("(%p) ref=%d\n", This, ref);
126 
127  if(!ref) {
128  IHTMLElementCollection_Release(&This->col->IHTMLElementCollection_iface);
129  heap_free(This);
130  }
131 
132  return ref;
133 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HTMLElementCollectionEnum_Reset()

static HRESULT WINAPI HTMLElementCollectionEnum_Reset ( IEnumVARIANT iface)
static

Definition at line 170 of file htmlelemcol.c.

171 {
173 
174  TRACE("(%p)->()\n", This);
175 
176  This->iter = 0;
177  return S_OK;
178 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85

◆ HTMLElementCollectionEnum_Skip()

static HRESULT WINAPI HTMLElementCollectionEnum_Skip ( IEnumVARIANT iface,
ULONG  celt 
)
static

Definition at line 155 of file htmlelemcol.c.

156 {
158 
159  TRACE("(%p)->(%d)\n", This, celt);
160 
161  if(This->iter + celt > This->col->len) {
162  This->iter = This->col->len;
163  return S_FALSE;
164  }
165 
166  This->iter += celt;
167  return S_OK;
168 }
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static HTMLElementCollectionEnum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: htmlelemcol.c:85

◆ impl_from_DispatchEx()

static HTMLElementCollection* impl_from_DispatchEx ( DispatchEx iface)
inlinestatic

Definition at line 533 of file htmlelemcol.c.

534 {
535  return CONTAINING_RECORD(iface, HTMLElementCollection, dispex);
536 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HTMLElementCollection_get_dispid(), and HTMLElementCollection_invoke().

◆ impl_from_IEnumVARIANT()

static HTMLElementCollectionEnum* impl_from_IEnumVARIANT ( IEnumVARIANT iface)
inlinestatic

Definition at line 85 of file htmlelemcol.c.

86 {
87  return CONTAINING_RECORD(iface, HTMLElementCollectionEnum, IEnumVARIANT_iface);
88 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HTMLElementCollectionEnum_AddRef(), HTMLElementCollectionEnum_Clone(), HTMLElementCollectionEnum_Next(), HTMLElementCollectionEnum_QueryInterface(), HTMLElementCollectionEnum_Release(), HTMLElementCollectionEnum_Reset(), and HTMLElementCollectionEnum_Skip().

◆ impl_from_IHTMLElementCollection()

static HTMLElementCollection* impl_from_IHTMLElementCollection ( IHTMLElementCollection *  iface)
inlinestatic

◆ is_elem_id()

static BOOL is_elem_id ( HTMLElement elem,
LPCWSTR  name 
)
static

Definition at line 337 of file htmlelemcol.c.

338 {
339  BSTR elem_id;
340  HRESULT hres;
341 
342  hres = IHTMLElement_get_id(&elem->IHTMLElement_iface, &elem_id);
343  if(FAILED(hres)){
344  WARN("IHTMLElement_get_id failed: 0x%08x\n", hres);
345  return FALSE;
346  }
347 
348  if(elem_id && !strcmpW(elem_id, name)) {
349  SysFreeString(elem_id);
350  return TRUE;
351  }
352 
353  SysFreeString(elem_id);
354  return FALSE;
355 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
OLECHAR * BSTR
Definition: compat.h:1934
static size_t elem
Definition: string.c:68
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

Referenced by HTMLElementCollection_get_dispid().

◆ is_elem_name()

static BOOL is_elem_name ( HTMLElement elem,
LPCWSTR  name 
)
static

Definition at line 357 of file htmlelemcol.c.

358 {
359  const PRUnichar *str;
360  nsAString nsstr;
361  BOOL ret = FALSE;
362  nsresult nsres;
363 
364  static const PRUnichar nameW[] = {'n','a','m','e',0};
365 
366  if(!elem->nselem)
367  return FALSE;
368 
369  nsAString_Init(&nsstr, NULL);
370  nsIDOMHTMLElement_GetId(elem->nselem, &nsstr);
371  nsAString_GetData(&nsstr, &str);
372  if(!strcmpiW(str, name)) {
373  nsAString_Finish(&nsstr);
374  return TRUE;
375  }
376 
377  nsres = get_elem_attr_value(elem->nselem, nameW, &nsstr, &str);
378  if(NS_SUCCEEDED(nsres)) {
379  ret = !strcmpiW(str, name);
380  nsAString_Finish(&nsstr);
381  }
382 
383  return ret;
384 }
#define TRUE
Definition: types.h:120
nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
Definition: htmlelem.c:143
unsigned int BOOL
Definition: ntddk_ex.h:94
static size_t elem
Definition: string.c:68
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR nameW[]
Definition: main.c:46
#define NS_SUCCEEDED(res)
int ret
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
#define strcmpiW(s1, s2)
Definition: unicode.h:39
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
Definition: name.c:36
HRESULT nsresult
Definition: nsiface.idl:39
WCHAR PRUnichar
Definition: nsiface.idl:48

Referenced by HTMLElementCollection_get_dispid(), and HTMLElementCollection_item().

◆ is_elem_node()

static BOOL is_elem_node ( nsIDOMNode node)
inlinestatic

Definition at line 76 of file htmlelemcol.c.

77 {
78  UINT16 type=0;
79 
80  nsIDOMNode_GetNodeType(node, &type);
81 
82  return type == ELEMENT_NODE || type == COMMENT_NODE;
83 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned short UINT16
Definition: dlist.c:348

Referenced by create_all_list(), and create_collection_from_nodelist().

Variable Documentation

◆ HTMLElementColection_dispex_vtbl

const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl
static
Initial value:
= {
}
static HRESULT HTMLElementCollection_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
Definition: htmlelemcol.c:540
smooth NULL
Definition: ftsmooth.c:416
static HRESULT HTMLElementCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
Definition: htmlelemcol.c:569

Definition at line 595 of file htmlelemcol.c.

◆ HTMLElementCollection_dispex

dispex_static_data_t HTMLElementCollection_dispex
static
Initial value:
= {
DispHTMLElementCollection_tid,
}
static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl
Definition: htmlelemcol.c:595
smooth NULL
Definition: ftsmooth.c:416
static const tid_t HTMLElementCollection_iface_tids[]
Definition: htmlelemcol.c:602

Definition at line 607 of file htmlelemcol.c.

Referenced by HTMLElementCollection_Create().

◆ HTMLElementCollection_iface_tids

const tid_t HTMLElementCollection_iface_tids[]
static
Initial value:
= {
IHTMLElementCollection_tid,
0
}

Definition at line 602 of file htmlelemcol.c.

◆ HTMLElementCollectionEnumVtbl

const IEnumVARIANTVtbl HTMLElementCollectionEnumVtbl
static
Initial value:
= {
}
static ULONG WINAPI HTMLElementCollectionEnum_Release(IEnumVARIANT *iface)
Definition: htmlelemcol.c:120
static HRESULT WINAPI HTMLElementCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
Definition: htmlelemcol.c:135
static HRESULT WINAPI HTMLElementCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
Definition: htmlelemcol.c:180
static HRESULT WINAPI HTMLElementCollectionEnum_Reset(IEnumVARIANT *iface)
Definition: htmlelemcol.c:170
static HRESULT WINAPI HTMLElementCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
Definition: htmlelemcol.c:90
static ULONG WINAPI HTMLElementCollectionEnum_AddRef(IEnumVARIANT *iface)
Definition: htmlelemcol.c:110
static HRESULT WINAPI HTMLElementCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: htmlelemcol.c:155

Definition at line 187 of file htmlelemcol.c.

Referenced by HTMLElementCollection_get__newEnum().

◆ HTMLElementCollectionVtbl

const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface, REFIID riid, void **ppv)
Definition: htmlelemcol.c:202
static ULONG WINAPI HTMLElementCollection_AddRef(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:225
static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames(IHTMLElementCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlelemcol.c:270
static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount(IHTMLElementCollection *iface, UINT *pctinfo)
Definition: htmlelemcol.c:256
static HRESULT WINAPI HTMLElementCollection_put_length(IHTMLElementCollection *iface, LONG v)
Definition: htmlelemcol.c:295
static HRESULT WINAPI HTMLElementCollection_get_length(IHTMLElementCollection *iface, LONG *p)
Definition: htmlelemcol.c:303
static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface, VARIANT name, VARIANT index, IDispatch **pdisp)
Definition: htmlelemcol.c:396
static HRESULT WINAPI HTMLElementCollection_Invoke(IHTMLElementCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlelemcol.c:278
static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, VARIANT tagName, IDispatch **pdisp)
Definition: htmlelemcol.c:474
static HRESULT WINAPI HTMLElementCollection_GetTypeInfo(IHTMLElementCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlelemcol.c:263
static HRESULT WINAPI HTMLElementCollection_toString(IHTMLElementCollection *iface, BSTR *String)
Definition: htmlelemcol.c:287
static HRESULT WINAPI HTMLElementCollection_get__newEnum(IHTMLElementCollection *iface, IUnknown **p)
Definition: htmlelemcol.c:314
static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface)
Definition: htmlelemcol.c:235

Definition at line 517 of file htmlelemcol.c.

Referenced by HTMLElementCollection_Create().