Commit 1381ced8 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Implement HTMLTitleElement's text property.

parent b4adbb4d
......@@ -103,15 +103,29 @@ static HRESULT WINAPI HTMLTitleElement_Invoke(IHTMLTitleElement *iface, DISPID d
static HRESULT WINAPI HTMLTitleElement_put_text(IHTMLTitleElement *iface, BSTR v)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString text;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&text, v);
nsres = nsIDOMNode_SetTextContent(This->element.node.nsnode, &text);
nsAString_Finish(&text);
return map_nsresult(nsres);
}
static HRESULT WINAPI HTMLTitleElement_get_text(IHTMLTitleElement *iface, BSTR *p)
{
HTMLTitleElement *This = impl_from_IHTMLTitleElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString text;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_InitDepend(&text, NULL);
nsres = nsIDOMNode_GetTextContent(This->element.node.nsnode, &text);
return return_nsstr(nsres, &text, p);
}
static const IHTMLTitleElementVtbl HTMLTitleElementVtbl = {
......
......@@ -533,6 +533,24 @@ sync_test("title", function() {
elem.title = "test";
ok(elem.title === "test", "div.title = " + elem.title);
ok(elem.getAttribute("title") === "test", "title attribute = " + elem.getAttribute("title"));
var orig = document.title;
document.title = "w i n e test";
var title = document.getElementsByTagName("title")[0];
ok(title.text === "w i n e test", "<title> element text = " + title.text);
title.text = "winetest";
ok(title.text === "winetest", "<title> element text after change = " + title.text);
ok(document.title === "winetest", "document.title after <title> change = " + document.title);
elem = document.createElement("title");
ok(elem.text === "", "detached <title> element text = " + elem.text);
elem.text = "foobar";
ok(elem.text === "foobar", "detached <title> element text after change = " + elem.text);
ok(document.title === "winetest", "document.title after detached <title> change = " + document.title);
title.parentNode.replaceChild(elem, title);
ok(document.title === "foobar", "document.title after <title> replaced = " + document.title);
document.title = orig;
});
sync_test("disabled", function() {
......
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