mshtml: Add IElementTraversal::get_firstElementChild implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
188a1d7d8f
commit
3c7415f715
|
@ -4953,8 +4953,25 @@ static HRESULT WINAPI ElementTraversal_Invoke(IElementTraversal *iface, DISPID d
|
||||||
static HRESULT WINAPI ElementTraversal_get_firstElementChild(IElementTraversal *iface, IHTMLElement **p)
|
static HRESULT WINAPI ElementTraversal_get_firstElementChild(IElementTraversal *iface, IHTMLElement **p)
|
||||||
{
|
{
|
||||||
HTMLElement *This = impl_from_IElementTraversal(iface);
|
HTMLElement *This = impl_from_IElementTraversal(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, p);
|
nsIDOMElement *nselem = NULL;
|
||||||
return E_NOTIMPL;
|
HTMLElement *elem;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
nsIDOMHTMLElement_GetFirstElementChild(This->nselem, &nselem);
|
||||||
|
if(!nselem) {
|
||||||
|
*p = NULL;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = get_elem(This->node.doc, nselem, &elem);
|
||||||
|
nsIDOMElement_Release(nselem);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return hres;
|
||||||
|
|
||||||
|
*p = &elem->IHTMLElement_iface;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ElementTraversal_get_lastElementChild(IElementTraversal *iface, IHTMLElement **p)
|
static HRESULT WINAPI ElementTraversal_get_lastElementChild(IElementTraversal *iface, IHTMLElement **p)
|
||||||
|
|
|
@ -80,7 +80,22 @@ function test_textContent() {
|
||||||
next_test();
|
next_test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_ElementTraversal() {
|
||||||
|
var div = document.createElement("div");
|
||||||
|
div.innerHTML = "abc<b>bold</b><script>/* */<script><div>text</div>def";
|
||||||
|
ok(div.firstElementChild.outerHTML === "<b>bold</b>",
|
||||||
|
"div.firstElementChild.outerHTML = " + div.firstElementChild.outerHTML);
|
||||||
|
|
||||||
|
div.innerHTML = "abc";
|
||||||
|
ok(div.firstElementChild === null, "div.firstElementChild = " + div.firstElementChild);
|
||||||
|
|
||||||
|
ok(!("firstElementChild" in document), "firstElementChild found in document");
|
||||||
|
|
||||||
|
next_test();
|
||||||
|
}
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test_input_selection,
|
test_input_selection,
|
||||||
test_textContent
|
test_textContent,
|
||||||
|
test_ElementTraversal
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue