Commit 281826eb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLDOMNode3::put_textContent implementation.

parent 8ef2d4ea
......@@ -1241,8 +1241,25 @@ static HRESULT WINAPI HTMLDOMNode3_get_namespaceURI(IHTMLDOMNode3 *iface, VARIAN
static HRESULT WINAPI HTMLDOMNode3_put_textContent(IHTMLDOMNode3 *iface, VARIANT v)
{
HTMLDOMNode *This = impl_from_IHTMLDOMNode3(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
if(V_VT(&v) != VT_BSTR) {
FIXME("unsupported argument %s\n", debugstr_variant(&v));
return E_NOTIMPL;
}
nsAString_Init(&nsstr, V_BSTR(&v));
nsres = nsIDOMNode_SetTextContent(This->nsnode, &nsstr);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres)) {
ERR("SetTextContent failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLDOMNode3_get_textContent(IHTMLDOMNode3 *iface, VARIANT *p)
......
......@@ -68,6 +68,15 @@ function test_textContent() {
div.innerHTML = "abc<script>/* */</script><div>text</div>";
ok(div.textContent === "abc/* */text", "div.textContent = " + div.textContent);
div.textContent = "test";
ok(div.textContent === "test", "div.textContent = " + div.textContent);
ok(div.childNodes.length === 1, "div.childNodes.length = " + div.childNodes.length);
ok(div.firstChild.textContent === "test", "div.firstChild.textContent = " + div.firstChild.textContent);
div.textContent = "";
ok(div.textContent === "", "div.textContent = " + div.textContent);
ok(div.childNodes.length === 0, "div.childNodes.length = " + div.childNodes.length);
next_test();
}
......
Markdown is supported
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