From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/omnavigator.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 7ba92cca10e..04779b76a1e 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -48,7 +48,7 @@ typedef struct { IHTMLDOMImplementation2 IHTMLDOMImplementation2_iface;
nsIDOMDOMImplementation *implementation; - GeckoBrowser *browser; + HTMLDocumentNode *doc; } HTMLDOMImplementation;
static inline HTMLDOMImplementation *impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation *iface) @@ -119,7 +119,7 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen
FIXME("(%p)->(%s %p)\n", This, debugstr_w(title), new_document);
- if(!This->browser) + if(!This->doc || !This->doc->browser) return E_UNEXPECTED;
nsAString_InitDepend(&title_str, title); @@ -130,7 +130,7 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen return E_FAIL; }
- hres = create_document_node(doc, This->browser, NULL, dispex_compat_mode(&This->dispex), &new_document_node); + hres = create_document_node(doc, This->doc->browser, NULL, dispex_compat_mode(&This->dispex), &new_document_node); nsIDOMDocument_Release(doc); if(FAILED(hres)) return hres; @@ -197,7 +197,7 @@ static void HTMLDOMImplementation_unlink(DispatchEx *dispex) static void HTMLDOMImplementation_destructor(DispatchEx *dispex) { HTMLDOMImplementation *This = HTMLDOMImplementation_from_DispatchEx(dispex); - assert(!This->browser); + assert(!This->doc); free(This); }
@@ -240,7 +240,7 @@ HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementa
dom_implementation->IHTMLDOMImplementation_iface.lpVtbl = &HTMLDOMImplementationVtbl; dom_implementation->IHTMLDOMImplementation2_iface.lpVtbl = &HTMLDOMImplementation2Vtbl; - dom_implementation->browser = doc_node->browser; + dom_implementation->doc = doc_node;
init_dispatch(&dom_implementation->dispex, &HTMLDOMImplementation_dispex, doc_node->window, doc_node->document_mode);
@@ -258,7 +258,7 @@ HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementa void detach_dom_implementation(IHTMLDOMImplementation *iface) { HTMLDOMImplementation *dom_implementation = impl_from_IHTMLDOMImplementation(iface); - dom_implementation->browser = NULL; + dom_implementation->doc = NULL; }
typedef struct {
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/tests/es5.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index b04c13de984..3d00f39cbc3 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2658,3 +2658,33 @@ sync_test("builtin_func", function() { ok(f.call(o, "test", 1) === false, 'f.call(o, "test", 1) = ' + f.call(o, "test", 1)); ok("" + f === "\nfunction hasFeature() {\n [native code]\n}\n", "f = " + f); }); + +async_test("script_global", function() { + // Created documents share script global, so their objects are instances of Object from + // the current script context. + var doc = document.implementation.createHTMLDocument("test"); + todo_wine. + ok(doc instanceof Object, "created doc is not an instance of Object"); + todo_wine. + ok(doc.implementation instanceof Object, "created doc.implementation is not an instance of Object"); + + document.body.innerHTML = ""; + var iframe = document.createElement("iframe"); + + // Documents created in iframe use iframe's script global, so their objects are not instances of + // current script context Object. + iframe.onload = guard(function() { + var doc = iframe.contentWindow.document; + ok(!(doc instanceof Object), "doc is an instance of Object"); + ok(!(doc.implementation instanceof Object), "doc.implementation is an instance of Object"); + + doc = doc.implementation.createHTMLDocument("test"); + ok(!(doc instanceof Object), "created iframe doc is an instance of Object"); + ok(!(doc.implementation instanceof Object), "created iframe doc.implementation is an instance of Object"); + + next_test(); + }); + + iframe.src = "about:blank"; + document.body.appendChild(iframe); +});
From: Jacek Caban jacek@codeweavers.com
And use it to create DOMImplementation. --- dlls/mshtml/htmldoc.c | 17 +++++++++++++---- dlls/mshtml/htmlwindow.c | 7 +++++-- dlls/mshtml/mshtml_private.h | 6 +++++- dlls/mshtml/omnavigator.c | 5 +++-- dlls/mshtml/tests/es5.js | 1 - 5 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e761356e05e..5eca382c3e0 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5337,6 +5337,10 @@ static void HTMLDocumentNode_unlink(DispatchEx *dispex) HTMLInnerWindow *window = This->window; HTMLDOMNode_unlink(dispex);
+ if(This->script_global) { + list_remove(&This->script_global_entry); + This->script_global = NULL; + } if(window) { This->window = NULL; IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); @@ -5709,7 +5713,7 @@ static dispex_static_data_t HTMLDocumentNode_dispex = { HTMLDocumentNode_init_dispex_info };
-static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window) +static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window, HTMLInnerWindow *script_global) { HTMLDocumentNode *doc;
@@ -5738,6 +5742,11 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo if(window) IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
+ if(script_global) { + doc->script_global = script_global; + list_add_tail(&script_global->documents, &doc->script_global_entry); + } + ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); @@ -5753,12 +5762,12 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo }
HRESULT create_document_node(nsIDOMDocument *nsdoc, GeckoBrowser *browser, HTMLInnerWindow *window, - compat_mode_t parent_mode, HTMLDocumentNode **ret) + HTMLInnerWindow *script_global, compat_mode_t parent_mode, HTMLDocumentNode **ret) { HTMLDocumentObj *doc_obj = browser->doc; HTMLDocumentNode *doc;
- doc = alloc_doc_node(doc_obj, window); + doc = alloc_doc_node(doc_obj, window, script_global); if(!doc) return E_OUTOFMEMORY;
@@ -5809,7 +5818,7 @@ static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *do { HTMLDocumentNode *doc_frag;
- doc_frag = alloc_doc_node(doc_node->doc_obj, doc_node->window); + doc_frag = alloc_doc_node(doc_node->doc_obj, doc_node->window, doc_node->script_global); if(!doc_frag) return E_OUTOFMEMORY;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 7cf4bf9738b..86e0ca51a30 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -109,7 +109,7 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN static void detach_inner_window(HTMLInnerWindow *window) { HTMLOuterWindow *outer_window = window->base.outer_window; - HTMLDocumentNode *doc = window->doc; + HTMLDocumentNode *doc = window->doc, *doc_iter;
while(!list_empty(&window->children)) { HTMLOuterWindow *child = LIST_ENTRY(list_tail(&window->children), HTMLOuterWindow, sibling_entry); @@ -126,6 +126,8 @@ static void detach_inner_window(HTMLInnerWindow *window) if(outer_window && is_main_content_window(outer_window)) window->doc->cp_container.forward_container = NULL;
+ LIST_FOR_EACH_ENTRY(doc_iter, &window->documents, HTMLDocumentNode, script_global_entry) + doc_iter->script_global = NULL; if(doc) detach_document_node(doc);
@@ -4239,6 +4241,7 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, return E_OUTOFMEMORY; window->base.IHTMLWindow2_iface.lpVtbl = &HTMLWindow2Vtbl;
+ list_init(&window->documents); list_init(&window->children); list_init(&window->script_hosts); list_init(&window->bindings); @@ -4367,7 +4370,7 @@ HRESULT update_window_doc(HTMLInnerWindow *window) if(outer_window->parent) parent_mode = outer_window->parent->base.inner_window->doc->document_mode;
- hres = create_document_node(nsdoc, outer_window->browser, window, parent_mode, &window->doc); + hres = create_document_node(nsdoc, outer_window->browser, window, window, parent_mode, &window->doc); nsIDOMDocument_Release(nsdoc); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a5e0f309ed9..f94f9b7ed6a 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -632,6 +632,7 @@ struct HTMLInnerWindow {
struct list children; struct list script_hosts; + struct list documents; IWineJScript *jscript;
IHTMLEventObj *event; @@ -994,6 +995,9 @@ struct HTMLDocumentNode { GeckoBrowser *browser; struct list browser_entry;
+ HTMLInnerWindow *script_global; + struct list script_global_entry; + compat_mode_t document_mode; BOOL document_mode_locked;
@@ -1027,7 +1031,7 @@ struct HTMLDocumentNode { HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**); HRESULT MHTMLDocument_Create(IUnknown*,REFIID,void**); HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); -HRESULT create_document_node(nsIDOMDocument*,GeckoBrowser*,HTMLInnerWindow*, +HRESULT create_document_node(nsIDOMDocument*,GeckoBrowser*,HTMLInnerWindow*,HTMLInnerWindow*, compat_mode_t,HTMLDocumentNode**); HRESULT create_doctype_node(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**);
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 04779b76a1e..83dbf029c44 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -130,7 +130,8 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen return E_FAIL; }
- hres = create_document_node(doc, This->doc->browser, NULL, dispex_compat_mode(&This->dispex), &new_document_node); + hres = create_document_node(doc, This->doc->browser, NULL, This->doc->script_global, + dispex_compat_mode(&This->dispex), &new_document_node); nsIDOMDocument_Release(doc); if(FAILED(hres)) return hres; @@ -242,7 +243,7 @@ HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementa dom_implementation->IHTMLDOMImplementation2_iface.lpVtbl = &HTMLDOMImplementation2Vtbl; dom_implementation->doc = doc_node;
- init_dispatch(&dom_implementation->dispex, &HTMLDOMImplementation_dispex, doc_node->window, doc_node->document_mode); + init_dispatch(&dom_implementation->dispex, &HTMLDOMImplementation_dispex, doc_node->script_global, doc_node->document_mode);
nsres = nsIDOMDocument_GetImplementation(doc_node->dom_document, &dom_implementation->implementation); if(NS_FAILED(nsres)) { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 3d00f39cbc3..f2e025ec864 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2665,7 +2665,6 @@ async_test("script_global", function() { var doc = document.implementation.createHTMLDocument("test"); todo_wine. ok(doc instanceof Object, "created doc is not an instance of Object"); - todo_wine. ok(doc.implementation instanceof Object, "created doc.implementation is not an instance of Object");
document.body.innerHTML = "";
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/omnavigator.c | 8 ++++---- dlls/mshtml/tests/documentmode.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 86e0ca51a30..9b7e69a25df 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3170,7 +3170,7 @@ static HRESULT WINAPI window_private_matchMedia(IWineHTMLWindowPrivate *iface, B
TRACE("iface %p, media_query %s\n", iface, debugstr_w(media_query));
- return create_media_query_list(This, media_query, media_query_list); + return create_media_query_list(This->inner_window, media_query, media_query_list); }
static HRESULT WINAPI window_private_get_console(IWineHTMLWindowPrivate *iface, IDispatch **console) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f94f9b7ed6a..4fd94034bfe 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1553,6 +1553,6 @@ IInternetSecurityManager *get_security_manager(void);
extern HINSTANCE hInst; void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret); -HRESULT create_media_query_list(HTMLWindow *window, BSTR media_query, IDispatch **ret); +HRESULT create_media_query_list(HTMLInnerWindow *window, BSTR media_query, IDispatch **ret);
HRESULT create_mutation_observer_ctor(compat_mode_t compat_mode, IDispatch **ret); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 83dbf029c44..21383808c32 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -2411,7 +2411,7 @@ static dispex_static_data_t media_query_list_dispex = { media_query_list_iface_tids };
-HRESULT create_media_query_list(HTMLWindow *window, BSTR media_query, IDispatch **ret) +HRESULT create_media_query_list(HTMLInnerWindow *window, BSTR media_query, IDispatch **ret) { struct media_query_list *media_query_list; nsISupports *nsunk; @@ -2433,7 +2433,7 @@ HRESULT create_media_query_list(HTMLWindow *window, BSTR media_query, IDispatch media_query_list->callback->ref = 1;
nsAString_InitDepend(&nsstr, media_query); - nsres = nsIDOMWindow_MatchMedia(window->outer_window->nswindow, &nsstr, &nsunk); + nsres = nsIDOMWindow_MatchMedia(window->dom_window, &nsstr, &nsunk); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { free(media_query_list->callback); @@ -2449,8 +2449,8 @@ HRESULT create_media_query_list(HTMLWindow *window, BSTR media_query, IDispatch
media_query_list->IWineMSHTMLMediaQueryList_iface.lpVtbl = &media_query_list_vtbl; list_init(&media_query_list->listeners); - init_dispatch(&media_query_list->dispex, &media_query_list_dispex, NULL, - dispex_compat_mode(&window->inner_window->event_target.dispex)); + init_dispatch(&media_query_list->dispex, &media_query_list_dispex, window, + dispex_compat_mode(&window->event_target.dispex));
*ret = (IDispatch*)&media_query_list->IWineMSHTMLMediaQueryList_iface; return S_OK; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 7362e0d16bf..3b2dca84c86 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -341,7 +341,7 @@ sync_test("builtin_toString", function() { if(v >= 10) { test("classList", e.classList, "DOMTokenList", "testclass another ", true); test("console", window.console, "Console", null, true); - test("mediaQueryList", window.matchMedia("(hover:hover)"), "MediaQueryList", null, true); + test("mediaQueryList", window.matchMedia("(hover:hover)"), "MediaQueryList"); } if(v >= 11) { test("MutationObserver", new window.MutationObserver(function() {}), "MutationObserver", null, true);
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/omnavigator.c | 5 +++-- dlls/mshtml/tests/documentmode.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 9b7e69a25df..40f738df8b3 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -829,7 +829,7 @@ static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigato
if(!window->navigator) { HRESULT hres; - hres = create_navigator(dispex_compat_mode(&window->event_target.dispex), &window->navigator); + hres = create_navigator(window, &window->navigator); if(FAILED(hres)) return hres; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4fd94034bfe..e3296ff1b5c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1043,7 +1043,7 @@ HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactor HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**); HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,HTMLXMLHttpRequestFactory**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); -HRESULT create_navigator(compat_mode_t,IOmNavigator**); +HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); HRESULT create_html_screen(HTMLInnerWindow*,IHTMLScreen**); HRESULT create_performance(HTMLInnerWindow*,IHTMLPerformance**); HRESULT create_history(HTMLInnerWindow*,OmHistory**); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 21383808c32..4eac4ffd7f8 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1159,7 +1159,7 @@ static dispex_static_data_t OmNavigator_dispex = { OmNavigator_iface_tids };
-HRESULT create_navigator(compat_mode_t compat_mode, IOmNavigator **navigator) +HRESULT create_navigator(HTMLInnerWindow *script_global, IOmNavigator **navigator) { OmNavigator *ret;
@@ -1169,7 +1169,8 @@ HRESULT create_navigator(compat_mode_t compat_mode, IOmNavigator **navigator)
ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
- init_dispatch(&ret->dispex, &OmNavigator_dispex, NULL, compat_mode); + init_dispatch(&ret->dispex, &OmNavigator_dispex, script_global, + dispex_compat_mode(&script_global->event_target.dispex));
*navigator = &ret->IOmNavigator_iface; return S_OK; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 3b2dca84c86..83559c07171 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -305,7 +305,7 @@ sync_test("builtin_toString", function() { if(localStorage) test("localStorage", localStorage, "Storage", null, true); test("location", window.location, "Object", window.location.href, null, true); if(v >= 11 /* todo_wine */) test("mimeTypes", window.navigator.mimeTypes, v < 11 ? "MSMimeTypesCollection" : "MimeTypeArray", null, true); - test("navigator", window.navigator, "Navigator", null, true); + test("navigator", window.navigator, "Navigator"); test("performance", window.performance, "Performance"); test("performanceNavigation", window.performance.navigation, "PerformanceNavigation"); test("performanceTiming", window.performance.timing, "PerformanceTiming");
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/selection.c | 2 +- dlls/mshtml/tests/documentmode.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 8c457f1813f..c20c24dad5f 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -253,7 +253,7 @@ HRESULT HTMLSelectionObject_Create(HTMLDocumentNode *doc, nsISelection *nsselect if(!selection) return E_OUTOFMEMORY;
- init_dispatch(&selection->dispex, &HTMLSelectionObject_dispex, NULL, + init_dispatch(&selection->dispex, &HTMLSelectionObject_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 83559c07171..94b00a07e82 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -326,7 +326,7 @@ sync_test("builtin_toString", function() { } if(v < 11) { test("eventObject", document.createEventObject(), "MSEventObj", null, true); - test("selection", document.selection, "MSSelection", null, true); + test("selection", document.selection, "MSSelection"); } if(v >= 9) { test("computedStyle", window.getComputedStyle(e), "CSSStyleDeclaration", null, true);
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/range.c | 2 +- dlls/mshtml/tests/documentmode.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 10f9de09ca8..7ba95fa7251 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1699,7 +1699,7 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode *doc, nsIDOMRange *nsrange, IHTMLTx if(!ret) return E_OUTOFMEMORY;
- init_dispatch(&ret->dispex, &HTMLTxtRange_dispex, NULL, + init_dispatch(&ret->dispex, &HTMLTxtRange_dispex, doc->script_global, dispex_compat_mode(&doc->node.event_target.dispex));
ret->IHTMLTxtRange_iface.lpVtbl = &HTMLTxtRangeVtbl; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 94b00a07e82..7ee5a94b785 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -318,7 +318,7 @@ sync_test("builtin_toString", function() { test("styleSheetRules", sheet.rules, "MSCSSRuleList", null, true); test("styleSheets", document.styleSheets, "StyleSheetList", null, true); test("textNode", document.createTextNode("testNode"), "Text", v < 9 ? "testNode" : null, true); - test("textRange", txtRange, "TextRange", null, true); + test("textRange", txtRange, "TextRange"); test("window", window, "Window", "[object Window]", true); test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest", null, true); if(v < 10) {
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/range.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 5eca382c3e0..0ed6b1d6710 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5129,7 +5129,7 @@ static HRESULT WINAPI DocumentRange_createRange(IDocumentRange *iface, IHTMLDOMR if(NS_FAILED(nsIDOMDocument_CreateRange(This->dom_document, &nsrange))) return E_FAIL;
- hres = create_dom_range(nsrange, dispex_compat_mode(&This->node.event_target.dispex), p); + hres = create_dom_range(nsrange, This, p); nsIDOMRange_Release(nsrange); return hres; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e3296ff1b5c..d944c3b93fc 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1159,7 +1159,7 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**); HRESULT create_style_sheet(nsIDOMStyleSheet*,compat_mode_t,IHTMLStyleSheet**); HRESULT create_style_sheet_collection(nsIDOMStyleSheetList*,compat_mode_t, IHTMLStyleSheetsCollection**); -HRESULT create_dom_range(nsIDOMRange*,compat_mode_t,IHTMLDOMRange**); +HRESULT create_dom_range(nsIDOMRange*,HTMLDocumentNode*,IHTMLDOMRange**); HRESULT create_markup_pointer(IMarkupPointer**);
void detach_document_node(HTMLDocumentNode*); diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 7ba95fa7251..4129834b9b7 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1997,7 +1997,7 @@ static dispex_static_data_t HTMLDOMRange_dispex = { HTMLDOMRange_iface_tids };
-HRESULT create_dom_range(nsIDOMRange *nsrange, compat_mode_t compat_mode, IHTMLDOMRange **p) +HRESULT create_dom_range(nsIDOMRange *nsrange, HTMLDocumentNode *doc, IHTMLDOMRange **p) { HTMLDOMRange *ret;
@@ -2005,7 +2005,8 @@ HRESULT create_dom_range(nsIDOMRange *nsrange, compat_mode_t compat_mode, IHTMLD if(!ret) return E_OUTOFMEMORY;
- init_dispatch(&ret->dispex, &HTMLDOMRange_dispex, NULL, compat_mode); + init_dispatch(&ret->dispex, &HTMLDOMRange_dispex, doc->script_global, + dispex_compat_mode(&doc->node.event_target.dispex));
ret->IHTMLDOMRange_iface.lpVtbl = &HTMLDOMRangeVtbl;
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/omnavigator.c | 4 ++-- dlls/mshtml/tests/documentmode.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 40f738df8b3..88c9879ac69 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3181,7 +3181,7 @@ static HRESULT WINAPI window_private_get_console(IWineHTMLWindowPrivate *iface, TRACE("iface %p, console %p.\n", iface, console);
if (!window->console) - create_console(dispex_compat_mode(&window->event_target.dispex), &window->console); + create_console(window, &window->console);
*console = (IDispatch *)window->console; if (window->console) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d944c3b93fc..e41b4fd592c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1552,7 +1552,7 @@ void set_statustext(HTMLDocumentObj*,INT,LPCWSTR); IInternetSecurityManager *get_security_manager(void);
extern HINSTANCE hInst; -void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret); +void create_console(HTMLInnerWindow *window, IWineMSHTMLConsole **ret); HRESULT create_media_query_list(HTMLInnerWindow *window, BSTR media_query, IDispatch **ret);
HRESULT create_mutation_observer_ctor(compat_mode_t compat_mode, IDispatch **ret); diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 4eac4ffd7f8..6284858b763 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -2122,7 +2122,7 @@ static dispex_static_data_t console_dispex = { console_iface_tids };
-void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret) +void create_console(HTMLInnerWindow *window, IWineMSHTMLConsole **ret) { struct console *obj;
@@ -2134,7 +2134,7 @@ void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret) }
obj->IWineMSHTMLConsole_iface.lpVtbl = &WineMSHTMLConsoleVtbl; - init_dispatch(&obj->dispex, &console_dispex, NULL, compat_mode); + init_dispatch(&obj->dispex, &console_dispex, window, dispex_compat_mode(&window->event_target.dispex));
*ret = &obj->IWineMSHTMLConsole_iface; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 7ee5a94b785..3d592e9c47d 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -340,7 +340,7 @@ sync_test("builtin_toString", function() { } if(v >= 10) { test("classList", e.classList, "DOMTokenList", "testclass another ", true); - test("console", window.console, "Console", null, true); + test("console", window.console, "Console"); test("mediaQueryList", window.matchMedia("(hover:hover)"), "MediaQueryList"); } if(v >= 11) {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147007
Your paranoid android.
=== w10pro64_zh_CN (64 bit report) ===
mshtml: htmldoc.c:353: Test failed: expected Exec_SETTITLE
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000005E00EE, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got hook 0x0009 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got hook 0x0005 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got winevent_hook 0x0003 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x030f instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x001c instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0086 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0006 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got hook 0x0009 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got winevent_hook 0x8005 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0007 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0008 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got winevent_hook 0x8005 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0007 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 3: the msg 0x00f3 was expected, but got msg 0x0138 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 6: the msg 0x0202 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 7: the msg 0x00f3 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 8: the msg 0x0138 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 10: the msg 0x0087 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 11: the msg 0x00f1 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 12: the msg 0x0087 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 13: the msg 0x00f1 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 14: the msg 0x0138 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 16: the msg 0x0087 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 17: the msg 0x00f1 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 18: the msg 0x0138 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 20: the msg 0x0087 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 22: the msg 0x0215 was expected, but got msg 0x0111 instead msg.c:7476: Test failed: BM_CLICK on auto-radio button: 23: in msg 0x0111 expecting wParam 0x1f6 got 0x601f6 msg.c:7476: Test failed: BM_CLICK on auto-radio button: 27: the msg sequence is not complete: expected msg 0000 - actual msg 00f3