mshtml: Added get_firstChild implementation.
This commit is contained in:
parent
1cb633a5cc
commit
6bf5ffbc3b
|
@ -246,8 +246,19 @@ static HRESULT WINAPI HTMLDOMNode_get_nodeValue(IHTMLDOMNode *iface, VARIANT *p)
|
||||||
static HRESULT WINAPI HTMLDOMNode_get_firstChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
|
static HRESULT WINAPI HTMLDOMNode_get_firstChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
|
||||||
{
|
{
|
||||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, p);
|
nsIDOMNode *nschild = NULL;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
nsIDOMNode_GetFirstChild(This->nsnode, &nschild);
|
||||||
|
if(nschild) {
|
||||||
|
*p = HTMLDOMNODE(get_node(This->doc, nschild, TRUE));
|
||||||
|
IHTMLDOMNode_AddRef(*p);
|
||||||
|
}else {
|
||||||
|
*p = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLDOMNode_get_lastChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
|
static HRESULT WINAPI HTMLDOMNode_get_lastChild(IHTMLDOMNode *iface, IHTMLDOMNode **p)
|
||||||
|
|
|
@ -738,6 +738,23 @@ static void _test_elem_collection(unsigned line, IHTMLElementCollection *col,
|
||||||
ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
|
ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define get_first_child(n) _get_first_child(__LINE__,n)
|
||||||
|
static IHTMLDOMNode *_get_first_child(unsigned line, IUnknown *unk)
|
||||||
|
{
|
||||||
|
IHTMLDOMNode *node, *child = NULL;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode, (void**)&node);
|
||||||
|
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLDOMNode: %08x\n", hres);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
hres = IHTMLDOMNode_get_firstChild(node, &child);
|
||||||
|
ok_(__FILE__,line) (hres == S_OK, "get_firstChild failed: %08x\n", hres);
|
||||||
|
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
static void test_elem_col_item(IHTMLElementCollection *col, LPCWSTR n,
|
static void test_elem_col_item(IHTMLElementCollection *col, LPCWSTR n,
|
||||||
const elem_type_t *elem_types, long len)
|
const elem_type_t *elem_types, long len)
|
||||||
{
|
{
|
||||||
|
@ -1379,6 +1396,7 @@ static void test_elems(IHTMLDocument2 *doc)
|
||||||
{
|
{
|
||||||
IHTMLElementCollection *col;
|
IHTMLElementCollection *col;
|
||||||
IHTMLElement *elem;
|
IHTMLElement *elem;
|
||||||
|
IHTMLDOMNode *node;
|
||||||
IDispatch *disp;
|
IDispatch *disp;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
@ -1451,6 +1469,13 @@ static void test_elems(IHTMLDocument2 *doc)
|
||||||
|
|
||||||
test_select_elem(select);
|
test_select_elem(select);
|
||||||
|
|
||||||
|
node = get_first_child((IUnknown*)select);
|
||||||
|
ok(node != NULL, "node == NULL\n");
|
||||||
|
if(node) {
|
||||||
|
test_elem_type((IUnknown*)node, ET_OPTION);
|
||||||
|
IHTMLDOMNode_Release(node);
|
||||||
|
}
|
||||||
|
|
||||||
IHTMLSelectElement_Release(select);
|
IHTMLSelectElement_Release(select);
|
||||||
IHTMLElement_Release(elem);
|
IHTMLElement_Release(elem);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue