From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/selection.c | 15 ++++++++------- dlls/mshtml/tests/documentmode.js | 6 ++++++ 3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 07ef3191c4d..0220285ac8e 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -458,6 +458,7 @@ typedef struct { X(MSCurrentStyleCSSProperties) \ X(MSEventObj) \ X(MSNamespaceInfoCollection) \ + X(MSSelection) \ X(MSStyleCSSProperties) \ X(MediaQueryList) \ X(MessageEvent) \ diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index c20c24dad5f..03d269dbb0a 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -233,16 +233,17 @@ static const dispex_static_data_vtbl_t HTMLSelectionObject_dispex_vtbl = { .unlink = HTMLSelectionObject_unlink };
-static const tid_t HTMLSelectionObject_iface_tids[] = { +static const tid_t MSSelection_iface_tids[] = { IHTMLSelectionObject_tid, IHTMLSelectionObject2_tid, 0 }; -static dispex_static_data_t HTMLSelectionObject_dispex = { - "MSSelection", - &HTMLSelectionObject_dispex_vtbl, - IHTMLSelectionObject_tid, /* FIXME: We have a test for that, but it doesn't expose IHTMLSelectionObject2 iface. */ - HTMLSelectionObject_iface_tids +dispex_static_data_t MSSelection_dispex = { + .id = PROT_MSSelection, + .vtbl = &HTMLSelectionObject_dispex_vtbl, + .disp_tid = IHTMLSelectionObject_tid, + .iface_tids = MSSelection_iface_tids, + .max_compat_mode = COMPAT_MODE_IE10, };
HRESULT HTMLSelectionObject_Create(HTMLDocumentNode *doc, nsISelection *nsselection, IHTMLSelectionObject **ret) @@ -253,7 +254,7 @@ HRESULT HTMLSelectionObject_Create(HTMLDocumentNode *doc, nsISelection *nsselect if(!selection) return E_OUTOFMEMORY;
- init_dispatch(&selection->dispex, &HTMLSelectionObject_dispex, doc->script_global, + init_dispatch(&selection->dispex, &MSSelection_dispex, doc->script_global, dispex_compat_mode(&doc->node.event_target.dispex));
selection->IHTMLSelectionObject_iface.lpVtbl = &HTMLSelectionObjectVtbl; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f144619cb85..13cef923018 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3314,4 +3314,10 @@ sync_test("prototypes", function() { check(document.body.createTextRange(), TextRange.prototype, "text range"); check(TextRange.prototype, Object.prototype, "text range prototype"); check(Range.prototype, Object.prototype, "range prototype"); + if(v < 11) { + check(document.selection, MSSelection.prototype, "selection"); + check(MSSelection.prototype, Object.prototype, "selection prototype"); + }else { + ok(!("MSSelection" in window), "MSSelection found in window"); + } });