mshtml: Added IHTMLDOMNode3::put_textContent implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8ef2d4ea83
commit
281826ebd0
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue