Commit 9881ec35 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLElement2::get_readyState implementation.

parent 2c6c00a8
......@@ -662,8 +662,27 @@ static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event,
static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
BSTR str;
TRACE("(%p)->(%p)\n", This, p);
if(This->node.vtbl->get_readystate) {
HRESULT hres;
hres = This->node.vtbl->get_readystate(&This->node, &str);
if(FAILED(hres))
return hres;
}else {
static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
str = SysAllocString(completeW);
if(!str)
return E_OUTOFMEMORY;
}
V_VT(p) = VT_BSTR;
V_BSTR(p) = str;
return S_OK;
}
static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
......
......@@ -72,6 +72,13 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
return S_OK;
}
static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p);
}
#undef HTMLIFRAME_NODE_THIS
static const NodeImplVtbl HTMLIFrameImplVtbl = {
......@@ -81,7 +88,8 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = {
NULL,
NULL,
NULL,
HTMLIFrame_get_document
HTMLIFrame_get_document,
HTMLIFrame_get_readystate
};
static const tid_t HTMLIFrame_iface_tids[] = {
......
......@@ -39,7 +39,7 @@ typedef struct {
nsIDOMHTMLImageElement *nsimg;
} HTMLImgElement;
#define HTMLIMG(x) (&(x)->lpHTMLImgElementVtbl)
#define HTMLIMG(x) ((IHTMLImgElement*) &(x)->lpHTMLImgElementVtbl)
#define HTMLIMG_THIS(iface) DEFINE_THIS(HTMLImgElement, HTMLImgElement, iface)
......@@ -572,11 +572,24 @@ static void HTMLImgElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node);
}
static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLImgElement *This = HTMLIMG_NODE_THIS(iface);
return IHTMLImgElement_get_readyState(HTMLIMG(This), p);
}
#undef HTMLIMG_NODE_THIS
static const NodeImplVtbl HTMLImgElementImplVtbl = {
HTMLImgElement_QI,
HTMLImgElement_destructor
HTMLImgElement_destructor,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLImgElement_get_readystate
};
static const tid_t HTMLImgElement_iface_tids[] = {
......
......@@ -39,7 +39,7 @@ typedef struct {
nsIDOMHTMLScriptElement *nsscript;
} HTMLScriptElement;
#define HTMLSCRIPT(x) (&(x)->lpHTMLScriptElementVtbl)
#define HTMLSCRIPT(x) ((IHTMLScriptElement*) &(x)->lpHTMLScriptElementVtbl)
#define HTMLSCRIPT_THIS(iface) DEFINE_THIS(HTMLScriptElement, HTMLScriptElement, iface)
......@@ -299,11 +299,24 @@ static void HTMLScriptElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node);
}
static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface);
return IHTMLScriptElement_get_readyState(HTMLSCRIPT(This), p);
}
#undef HTMLSCRIPT_NODE_THIS
static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_QI,
HTMLScriptElement_destructor
HTMLScriptElement_destructor,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLScriptElement_get_readystate
};
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
......
......@@ -449,6 +449,7 @@ typedef struct {
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
HRESULT (*get_readystate)(HTMLDOMNode*,BSTR*);
} NodeImplVtbl;
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