Commit 1075118c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mshtml: Implement IHTMLFrameBase_put_name().

parent a82278c3
......@@ -148,8 +148,28 @@ static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString name_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->nsframe && !This->nsiframe) {
ERR("No attached ns frame object\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&name_str, v);
if(This->nsframe)
nsres = nsIDOMHTMLFrameElement_SetName(This->nsframe, &name_str);
else
nsres = nsIDOMHTMLIFrameElement_SetName(This->nsiframe, &name_str);
nsAString_Finish(&name_str);
if(NS_FAILED(nsres)) {
ERR("SetName failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
......
......@@ -4227,6 +4227,25 @@ static void _test_framebase_name(unsigned line, IHTMLElement *elem, const char *
IHTMLFrameBase_Release(fbase);
}
#define test_framebase_put_name(a,b) _test_framebase_put_name(__LINE__,a,b)
static void _test_framebase_put_name(unsigned line, IHTMLElement *elem, const char *name)
{
IHTMLFrameBase *fbase;
HRESULT hres;
BSTR str;
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLFrameBase, (void**)&fbase);
ok(hres == S_OK, "Could not get IHTMLFrameBase interface: 0x%08x\n", hres);
str = name ? a2bstr(name) : NULL;
hres = IHTMLFrameBase_put_name(fbase, str);
ok_(__FILE__,line)(hres == S_OK, "put_name failed: %08x\n", hres);
SysFreeString(str);
_test_framebase_name(line, elem, name);
IHTMLFrameBase_Release(fbase);
}
static void test_framebase(IUnknown *unk)
{
IHTMLFrameBase *fbase;
......@@ -6273,12 +6292,16 @@ static void test_frameset(IHTMLDocument2 *doc)
test_framebase((IUnknown*)elem);
test_framebase_name(elem, "nm1");
test_framebase_put_name(elem, "frame name");
test_framebase_put_name(elem, NULL);
test_framebase_put_name(elem, "nm1");
IHTMLElement_Release(elem);
/* get_name with no name attr */
elem = get_doc_elem_by_id(doc, "fr3");
test_framebase_name(elem, NULL);
test_framebase_put_name(elem, "frame name");
test_framebase_put_name(elem, NULL);
IHTMLElement_Release(elem);
IHTMLWindow2_Release(window);
......
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