mshtml: Added IHTMLIFrameElement3::get_contentDocument implementation.

This commit is contained in:
Jacek Caban 2012-10-11 14:09:01 +02:00 committed by Alexandre Julliard
parent c9e5181ff3
commit 8d1dc99ea1
2 changed files with 26 additions and 2 deletions

View File

@ -318,8 +318,19 @@ static HRESULT WINAPI HTMLIFrameElement3_Invoke(IHTMLIFrameElement3 *iface, DISP
static HRESULT WINAPI HTMLIFrameElement3_get_contentDocument(IHTMLIFrameElement3 *iface, IDispatch **p)
{
HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
IHTMLDocument2 *doc;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(!This->framebase.content_window) {
*p = NULL;
return S_OK;
}
hres = IHTMLWindow2_get_document(&This->framebase.content_window->base.IHTMLWindow2_iface, &doc);
*p = (IDispatch*)doc;
return hres;
}
static HRESULT WINAPI HTMLIFrameElement3_put_src(IHTMLIFrameElement3 *iface, BSTR v)

View File

@ -5082,6 +5082,7 @@ static void test_frame_doc(IUnknown *frame_elem, BOOL iframe)
static void test_iframe_elem(IHTMLElement *elem)
{
IHTMLDocument2 *content_doc, *owner_doc;
IHTMLIFrameElement3 *iframe3;
IHTMLElementCollection *col;
IHTMLWindow2 *content_window;
IHTMLElement *body;
@ -5108,6 +5109,18 @@ static void test_iframe_elem(IHTMLElement *elem)
content_doc = get_window_doc(content_window);
IHTMLWindow2_Release(content_window);
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLIFrameElement3, (void**)&iframe3);
if(SUCCEEDED(hres)) {
hres = IHTMLIFrameElement3_get_contentDocument(iframe3, &disp);
ok(hres == S_OK, "get_contentDocument failed: %08x\n", hres);
ok(iface_cmp((IUnknown*)content_doc, (IUnknown*)disp), "content_doc != disp\n");
IDispatch_Release(disp);
IHTMLIFrameElement3_Release(iframe3);
}else {
win_skip("IHTMLIFrameElement3 not supported\n");
}
str = a2bstr("text/html");
V_VT(&errv) = VT_ERROR;
disp = NULL;