Commit 9bf516a8 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

mshtml: Search content_window's properties in HTML[I]FrameBase::get_dispid.

parent d6dfcf94
...@@ -597,6 +597,30 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p) ...@@ -597,6 +597,30 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
return S_OK; return S_OK;
} }
static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name,
DWORD grfdex, DISPID *pid)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
if(!This->framebase.content_window)
return DISP_E_UNKNOWNNAME;
return search_window_props(This->framebase.content_window, name, grfdex, pid);
}
static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
if(!This->framebase.content_window) {
ERR("no content window to invoke on\n");
return E_FAIL;
}
return IDispatchEx_InvokeEx(DISPATCHEX(This->framebase.content_window), id, lcid, flags, params, res, ei, caller);
}
static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface) static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
...@@ -626,8 +650,8 @@ static const NodeImplVtbl HTMLFrameElementImplVtbl = { ...@@ -626,8 +650,8 @@ static const NodeImplVtbl HTMLFrameElementImplVtbl = {
NULL, NULL,
HTMLFrameElement_get_document, HTMLFrameElement_get_document,
NULL, NULL,
NULL, HTMLFrameElement_get_dispid,
NULL, HTMLFrameElement_invoke,
HTMLFrameElement_bind_to_tree HTMLFrameElement_bind_to_tree
}; };
......
...@@ -65,6 +65,30 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p) ...@@ -65,6 +65,30 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
return S_OK; return S_OK;
} }
static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name,
DWORD grfdex, DISPID *pid)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
if(!This->framebase.content_window)
return DISP_E_UNKNOWNNAME;
return search_window_props(This->framebase.content_window, name, grfdex, pid);
}
static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
if(!This->framebase.content_window) {
ERR("no content window to invoke on\n");
return E_FAIL;
}
return IDispatchEx_InvokeEx(DISPATCHEX(This->framebase.content_window), id, lcid, flags, params, res, ei, caller);
}
static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
...@@ -101,8 +125,8 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = { ...@@ -101,8 +125,8 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = {
NULL, NULL,
HTMLIFrame_get_document, HTMLIFrame_get_document,
HTMLIFrame_get_readystate, HTMLIFrame_get_readystate,
NULL, HTMLIFrame_get_dispid,
NULL, HTMLIFrame_invoke,
HTMLIFrame_bind_to_tree HTMLIFrame_bind_to_tree
}; };
......
...@@ -1721,15 +1721,11 @@ static inline DWORD prop_to_dispid(HTMLWindow *This, global_prop_t *prop) ...@@ -1721,15 +1721,11 @@ static inline DWORD prop_to_dispid(HTMLWindow *This, global_prop_t *prop)
return MSHTML_DISPID_CUSTOM_MIN + (prop-This->global_props); return MSHTML_DISPID_CUSTOM_MIN + (prop-This->global_props);
} }
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) HRESULT search_window_props(HTMLWindow *This, BSTR bstrName, DWORD grfdex, DISPID *pid)
{ {
HTMLWindow *This = DISPEX_THIS(iface); DWORD i;
ScriptHost *script_host; ScriptHost *script_host;
DISPID id; DISPID id;
DWORD i;
HRESULT hres;
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
for(i=0; i < This->global_prop_cnt; i++) { for(i=0; i < This->global_prop_cnt; i++) {
/* FIXME: case sensitivity */ /* FIXME: case sensitivity */
...@@ -1753,6 +1749,20 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, ...@@ -1753,6 +1749,20 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
return S_OK; return S_OK;
} }
return DISP_E_UNKNOWNNAME;
}
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
HTMLWindow *This = DISPEX_THIS(iface);
HRESULT hres;
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
hres = search_window_props(This, bstrName, grfdex, pid);
if(hres != DISP_E_UNKNOWNNAME)
return hres;
hres = IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid); hres = IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
if(hres != DISP_E_UNKNOWNNAME) if(hres != DISP_E_UNKNOWNNAME)
return hres; return hres;
......
...@@ -779,6 +779,7 @@ IDispatch *script_parse_event(HTMLWindow*,LPCWSTR); ...@@ -779,6 +779,7 @@ IDispatch *script_parse_event(HTMLWindow*,LPCWSTR);
void set_script_mode(HTMLWindow*,SCRIPTMODE); void set_script_mode(HTMLWindow*,SCRIPTMODE);
BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*); BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*);
IDispatch *get_script_disp(ScriptHost*); IDispatch *get_script_disp(ScriptHost*);
HRESULT search_window_props(HTMLWindow*,BSTR,DWORD,DISPID*);
IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL); IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL);
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,IUnknown*,nsIDOMNodeList*); IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,IUnknown*,nsIDOMNodeList*);
......
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