Commit b4adbb4d authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard
Browse files

mshtml: Implement childElementCount for Elements.



Signed-off-by: Gabriel Ivăncescu's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent 107f318e
......@@ -6611,8 +6611,15 @@ static HRESULT WINAPI ElementTraversal_get_nextElementSibling(IElementTraversal
static HRESULT WINAPI ElementTraversal_get_childElementCount(IElementTraversal *iface, LONG *p)
{
HTMLElement *This = impl_from_IElementTraversal(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
UINT32 count = 0;
TRACE("(%p)->(%p)\n", This, p);
if(This->dom_element)
nsIDOMElement_GetChildElementCount(This->dom_element, &count);
*p = count;
return S_OK;
}
static const IElementTraversalVtbl ElementTraversalVtbl = {
......
......@@ -90,6 +90,7 @@ sync_test("textContent", function() {
sync_test("ElementTraversal", function() {
var div = document.createElement("div");
div.innerHTML = "abc<b>bold</b><script>/* */</script><div>text</div>def";
ok(div.childElementCount === 3, "div.childElementCount = " + div.childElementCount);
ok(div.firstElementChild.outerHTML === "<b>bold</b>",
"div.firstElementChild.outerHTML = " + div.firstElementChild.outerHTML);
ok(div.lastElementChild.outerHTML === "<div>text</div>",
......@@ -104,9 +105,11 @@ sync_test("ElementTraversal", function() {
"div.firstElementChild.previousElementSibling = " + div.firstElementChild.previousElementSibling);
div.innerHTML = "abc";
ok(div.childElementCount === 0, "div.childElementCount = " + div.childElementCount);
ok(div.firstElementChild === null, "div.firstElementChild = " + div.firstElementChild);
ok(div.lastElementChild === null, "div.lastElementChild = " + div.lastElementChild);
ok(!("childElementCount" in document), "childElementCount found in document");
ok(!("firstElementChild" in document), "firstElementChild found in document");
ok(!("nextElementSibling" in document), "nextElementSibling found in document");
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment