Commit 99937172 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Return content document in get_document for frame elements.

parent 7c64ab1e
...@@ -569,9 +569,11 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch ** ...@@ -569,9 +569,11 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **
if(!p) if(!p)
return E_POINTER; 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); *p = (IDispatch*)HTMLDOC(&This->node.doc->basedoc);
IDispatch_AddRef(*p); IDispatch_AddRef(*p);
return S_OK; return S_OK;
} }
......
...@@ -443,11 +443,30 @@ static void HTMLFrameElement_destructor(HTMLDOMNode *iface) ...@@ -443,11 +443,30 @@ static void HTMLFrameElement_destructor(HTMLDOMNode *iface)
HTMLFrameBase_destructor(&This->framebase); 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 #undef HTMLFRAME_NODE_THIS
static const NodeImplVtbl HTMLFrameElementImplVtbl = { static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI, HTMLFrameElement_QI,
HTMLFrameElement_destructor HTMLFrameElement_destructor,
NULL,
NULL,
NULL,
NULL,
HTMLFrameElement_get_document
}; };
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLWindow *content_window) HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLWindow *content_window)
......
...@@ -58,11 +58,30 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface) ...@@ -58,11 +58,30 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface)
HTMLFrameBase_destructor(&This->framebase); 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 #undef HTMLIFRAME_NODE_THIS
static const NodeImplVtbl HTMLIFrameImplVtbl = { static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_QI, HTMLIFrame_QI,
HTMLIFrame_destructor HTMLIFrame_destructor,
NULL,
NULL,
NULL,
NULL,
HTMLIFrame_get_document
}; };
static const tid_t HTMLIFrame_iface_tids[] = { static const tid_t HTMLIFrame_iface_tids[] = {
......
...@@ -445,6 +445,7 @@ typedef struct { ...@@ -445,6 +445,7 @@ typedef struct {
HRESULT (*call_event)(HTMLDOMNode*,DWORD,BOOL*); HRESULT (*call_event)(HTMLDOMNode*,DWORD,BOOL*);
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL); HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*); HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
} NodeImplVtbl; } NodeImplVtbl;
struct HTMLDOMNode { struct HTMLDOMNode {
......
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