mshtml: Return content document in get_document for frame elements.

This commit is contained in:
Jacek Caban 2009-11-24 21:13:38 +01:00 committed by Alexandre Julliard
parent 7c64ab1e83
commit 999371724a
4 changed files with 44 additions and 3 deletions

View File

@ -569,9 +569,11 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **
if(!p)
return E_POINTER;
if(This->node.vtbl->get_document)
return This->node.vtbl->get_document(&This->node, p);
*p = (IDispatch*)HTMLDOC(&This->node.doc->basedoc);
IDispatch_AddRef(*p);
return S_OK;
}

View File

@ -443,11 +443,30 @@ static void HTMLFrameElement_destructor(HTMLDOMNode *iface)
HTMLFrameBase_destructor(&This->framebase);
}
static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
if(!This->framebase.content_window || !This->framebase.content_window->doc) {
*p = NULL;
return S_OK;
}
*p = (IDispatch*)HTMLDOC(&This->framebase.content_window->doc->basedoc);
IDispatch_AddRef(*p);
return S_OK;
}
#undef HTMLFRAME_NODE_THIS
static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI,
HTMLFrameElement_destructor
HTMLFrameElement_destructor,
NULL,
NULL,
NULL,
NULL,
HTMLFrameElement_get_document
};
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLWindow *content_window)

View File

@ -58,11 +58,30 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface)
HTMLFrameBase_destructor(&This->framebase);
}
static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
if(!This->framebase.content_window || !This->framebase.content_window->doc) {
*p = NULL;
return S_OK;
}
*p = (IDispatch*)HTMLDOC(&This->framebase.content_window->doc->basedoc);
IDispatch_AddRef(*p);
return S_OK;
}
#undef HTMLIFRAME_NODE_THIS
static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_QI,
HTMLIFrame_destructor
HTMLIFrame_destructor,
NULL,
NULL,
NULL,
NULL,
HTMLIFrame_get_document
};
static const tid_t HTMLIFrame_iface_tids[] = {

View File

@ -445,6 +445,7 @@ typedef struct {
HRESULT (*call_event)(HTMLDOMNode*,DWORD,BOOL*);
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
} NodeImplVtbl;
struct HTMLDOMNode {