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

This commit is contained in:
Andrew Eikum 2009-12-14 17:38:53 -06:00 committed by Alexandre Julliard
parent d6dfcf94b0
commit 9bf516a813
4 changed files with 69 additions and 10 deletions

View File

@ -597,6 +597,30 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
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)
{
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface);
@ -626,8 +650,8 @@ static const NodeImplVtbl HTMLFrameElementImplVtbl = {
NULL,
HTMLFrameElement_get_document,
NULL,
NULL,
NULL,
HTMLFrameElement_get_dispid,
HTMLFrameElement_invoke,
HTMLFrameElement_bind_to_tree
};

View File

@ -65,6 +65,30 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
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)
{
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
@ -101,8 +125,8 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = {
NULL,
HTMLIFrame_get_document,
HTMLIFrame_get_readystate,
NULL,
NULL,
HTMLIFrame_get_dispid,
HTMLIFrame_invoke,
HTMLIFrame_bind_to_tree
};

View File

@ -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);
}
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;
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++) {
/* FIXME: case sensitivity */
@ -1753,6 +1749,20 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
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);
if(hres != DISP_E_UNKNOWNNAME)
return hres;

View File

@ -779,6 +779,7 @@ IDispatch *script_parse_event(HTMLWindow*,LPCWSTR);
void set_script_mode(HTMLWindow*,SCRIPTMODE);
BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*);
IDispatch *get_script_disp(ScriptHost*);
HRESULT search_window_props(HTMLWindow*,BSTR,DWORD,DISPID*);
IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL);
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,IUnknown*,nsIDOMNodeList*);