mshtml: Don't expose doScroll in IE11 document mode.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-05-09 17:32:33 +02:00 committed by Alexandre Julliard
parent 19a79f4228
commit 97e2600607
5 changed files with 24 additions and 10 deletions

View file

@ -325,9 +325,10 @@ static void add_func_info(dispex_data_t *data, tid_t tid, const FUNCDESC *desc,
}
}
static HRESULT process_interface(dispex_data_t *data, tid_t tid, ITypeInfo *disp_typeinfo)
static HRESULT process_interface(dispex_data_t *data, tid_t tid, ITypeInfo *disp_typeinfo, const DISPID *blacklist_dispids)
{
unsigned i = 7; /* skip IDispatch functions */
const DISPID *blacklist_iter;
ITypeInfo *typeinfo;
FUNCDESC *funcdesc;
HRESULT hres;
@ -341,20 +342,29 @@ static HRESULT process_interface(dispex_data_t *data, tid_t tid, ITypeInfo *disp
if(FAILED(hres))
break;
TRACE("adding...\n");
if(blacklist_dispids) {
for(blacklist_iter = blacklist_dispids; *blacklist_iter != DISPID_UNKNOWN; blacklist_iter++) {
if(*blacklist_iter == funcdesc->memid)
break;
}
}
if(!blacklist_dispids || *blacklist_iter == DISPID_UNKNOWN) {
TRACE("adding...\n");
add_func_info(data, tid, funcdesc, disp_typeinfo ? disp_typeinfo : typeinfo);
}
add_func_info(data, tid, funcdesc, disp_typeinfo ? disp_typeinfo : typeinfo);
ITypeInfo_ReleaseFuncDesc(typeinfo, funcdesc);
}
return S_OK;
}
void dispex_info_add_interface(dispex_data_t *info, tid_t tid)
void dispex_info_add_interface(dispex_data_t *info, tid_t tid, const DISPID *blacklist_dispids)
{
HRESULT hres;
hres = process_interface(info, tid, NULL);
hres = process_interface(info, tid, NULL, blacklist_dispids);
if(FAILED(hres))
ERR("process_interface failed: %08x\n", hres);
}
@ -406,7 +416,7 @@ static dispex_data_t *preprocess_dispex_data(const dispex_static_data_t *desc, c
desc->init_info(data, compat_mode);
for(tid = desc->iface_tids; *tid; tid++) {
hres = process_interface(data, *tid, dti);
hres = process_interface(data, *tid, dti, NULL);
if(FAILED(hres))
break;
}

View file

@ -5174,8 +5174,12 @@ static void HTMLElement_bind_event(DispatchEx *dispex, int eid)
void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
{
static const DISPID elem2_ie11_blacklist[] = {DISPID_IHTMLELEMENT2_DOSCROLL, DISPID_UNKNOWN};
dispex_info_add_interface(info, IHTMLElement2_tid, mode >= COMPAT_MODE_IE11 ? elem2_ie11_blacklist : NULL);
if(mode >= COMPAT_MODE_IE8)
dispex_info_add_interface(info, IElementSelector_tid);
dispex_info_add_interface(info, IElementSelector_tid, NULL);
}
static const tid_t HTMLElement_iface_tids[] = {

View file

@ -3029,7 +3029,7 @@ static void HTMLWindow_bind_event(DispatchEx *dispex, int eid)
static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode)
{
dispex_info_add_interface(info, IHTMLWindow5_tid);
dispex_info_add_interface(info, IHTMLWindow5_tid, NULL);
}
static const dispex_static_data_vtbl_t HTMLWindow_dispex_vtbl = {

View file

@ -318,7 +318,7 @@ void dispex_unlink(DispatchEx*) DECLSPEC_HIDDEN;
void release_typelib(void) DECLSPEC_HIDDEN;
HRESULT get_class_typeinfo(const CLSID*,ITypeInfo**) DECLSPEC_HIDDEN;
const dispex_static_data_vtbl_t *dispex_get_vtbl(DispatchEx*) DECLSPEC_HIDDEN;
void dispex_info_add_interface(dispex_data_t*,tid_t) DECLSPEC_HIDDEN;
void dispex_info_add_interface(dispex_data_t*,tid_t,const DISPID*) DECLSPEC_HIDDEN;
static inline void init_dispex(DispatchEx *dispex, IUnknown *outer, dispex_static_data_t *desc)
{
@ -760,7 +760,6 @@ typedef struct {
IHTMLDOMNode_tid, \
IHTMLDOMNode2_tid, \
IHTMLElement_tid, \
IHTMLElement2_tid, \
IHTMLElement3_tid, \
IHTMLElement4_tid, \
IHTMLUniqueName_tid

View file

@ -28,6 +28,7 @@ function test_elem_props() {
var v = document.documentMode;
test_exposed("doScroll", v < 11);
test_exposed("querySelectorAll", v >= 8);
next_test();