From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlwindow.c | 4 +++- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/omnavigator.c | 15 ++++++++------- dlls/mshtml/tests/documentmode.js | 6 ++++++ 4 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ea1f7f4b278..30ad3e0fd0d 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3810,10 +3810,12 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO sizeof(constructor_names[0]), cmp_name); if(constr_name) { prototype_id_t id = constr_name - constructor_names + 1; + compat_mode_t compat_mode = dispex_compat_mode(dispex); DispatchEx *constr; VARIANT v;
- if(dispex_compat_mode(dispex) >= object_descriptors[id]->min_compat_mode) { + if(compat_mode >= object_descriptors[id]->min_compat_mode && + (!object_descriptors[id]->max_compat_mode || compat_mode <= object_descriptors[id]->max_compat_mode)) { hres = get_constructor(This, id, &constr); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7dbfd4ecec8..9c38b407451 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -453,6 +453,7 @@ typedef struct { X(MSCSSRuleList) \ X(MSCurrentStyleCSSProperties) \ X(MSEventObj) \ + X(MSNamespaceInfoCollection) \ X(MSStyleCSSProperties) \ X(MessageEvent) \ X(MimeTypeArray) \ @@ -505,6 +506,7 @@ typedef struct { prototype_id_t constructor_id; UINT32 js_flags; compat_mode_t min_compat_mode; + compat_mode_t max_compat_mode; char prototype_name[64]; } dispex_static_data_t;
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index d781d17eefb..e9988b6c9c4 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1910,15 +1910,16 @@ static const dispex_static_data_vtbl_t HTMLNamespaceCollection_dispex_vtbl = { .destructor = HTMLNamespaceCollection_destructor, };
-static const tid_t HTMLNamespaceCollection_iface_tids[] = { +static const tid_t MSNamespaceInfoCollection_iface_tids[] = { IHTMLNamespaceCollection_tid, 0 }; -static dispex_static_data_t HTMLNamespaceCollection_dispex = { - "MSNamespaceInfoCollection", - &HTMLNamespaceCollection_dispex_vtbl, - DispHTMLNamespaceCollection_tid, - HTMLNamespaceCollection_iface_tids +dispex_static_data_t MSNamespaceInfoCollection_dispex = { + .id = PROT_MSNamespaceInfoCollection, + .vtbl = &HTMLNamespaceCollection_dispex_vtbl, + .disp_tid = DispHTMLNamespaceCollection_tid, + .iface_tids = MSNamespaceInfoCollection_iface_tids, + .max_compat_mode = COMPAT_MODE_IE9, };
HRESULT create_namespace_collection(HTMLDocumentNode *doc, IHTMLNamespaceCollection **ret) @@ -1929,7 +1930,7 @@ HRESULT create_namespace_collection(HTMLDocumentNode *doc, IHTMLNamespaceCollect return E_OUTOFMEMORY;
namespaces->IHTMLNamespaceCollection_iface.lpVtbl = &HTMLNamespaceCollectionVtbl; - init_dispatch(&namespaces->dispex, &HTMLNamespaceCollection_dispex, doc->script_global, + init_dispatch(&namespaces->dispex, &MSNamespaceInfoCollection_dispex, doc->script_global, dispex_compat_mode(&doc->node.event_target.dispex)); *ret = &namespaces->IHTMLNamespaceCollection_iface; return S_OK; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 1677a682146..2e463f231f5 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3279,4 +3279,10 @@ sync_test("prototypes", function() { check(PerformanceNavigation.prototype, Object.prototype, "navigation prototype"); check(performance, Performance.prototype, "performance"); check(Performance.prototype, Object.prototype, "performance prototype"); + if(v < 10) { + check(document.namespaces, MSNamespaceInfoCollection.prototype, "namespaces"); + check(MSNamespaceInfoCollection.prototype, Object.prototype, "namespaces prototype"); + }else { + ok(!("MSNamespaceInfoCollection" in window), "MSNamespaceInfoCollection found in window"); + } });