-- v2: mshtml: Return proper errors when navigating with no browser. mshtml: Set outer window to uninitialized page when document obj is released.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
This is also necessary to prevent leaks when the inner window will hold ref to the outer. Despite the CC handling this, it's not enough, because the script engine has to be detached (it also holds a ref).
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 45 +++++++++++++++++- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/oleobj.c | 14 +++++- dlls/mshtml/tests/events.c | 92 ++++++++++++++++++++++++++++++++++++ dlls/mshtml/tests/htmldoc.c | 36 +++++++++++++- dlls/mshtml/tests/script.c | 17 +++++++ 6 files changed, 200 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 2034ae8487a..cd888fc3e45 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2906,7 +2906,7 @@ static HRESULT WINAPI HTMLPrivateWindow_GetAddressBarUrl(IHTMLPrivateWindow *ifa if(!url) return E_INVALIDARG;
- *url = SysAllocString(This->outer_window->url); + *url = SysAllocString(This->outer_window->url ? This->outer_window->url : L"about:blank"); return S_OK; }
@@ -4525,6 +4525,49 @@ HRESULT create_pending_window(HTMLOuterWindow *outer_window, nsChannelBSC *chann return S_OK; }
+void set_window_uninitialized(HTMLOuterWindow *window, HTMLDocumentNode *doc_node) +{ + nsIDOMDOMImplementation *implementation; + nsIDOMDocument *nsdoc; + nsAString nsstr; + nsresult nsres; + HRESULT hres; + + window->readystate = READYSTATE_UNINITIALIZED; + set_current_uri(window, NULL); + if(window->mon) { + IMoniker_Release(window->mon); + window->mon = NULL; + } + + hres = create_pending_window(window, NULL); + if(FAILED(hres)) + return; + + nsres = nsIDOMDocument_GetImplementation(doc_node->dom_document, &implementation); + if(NS_FAILED(nsres)) + return; + + nsAString_InitDepend(&nsstr, L""); + nsres = nsIDOMDOMImplementation_CreateHTMLDocument(implementation, &nsstr, &nsdoc); + nsIDOMDOMImplementation_Release(implementation); + nsAString_Finish(&nsstr); + if(NS_FAILED(nsres)) + return; + + hres = create_document_node(nsdoc, window->browser, window->pending_window, COMPAT_MODE_QUIRKS, &window->pending_window->doc); + nsIDOMDocument_Release(nsdoc); + if(FAILED(hres)) + return; + window->pending_window->doc->doc_obj = NULL; + window->pending_window->doc->cp_container.forward_container = NULL; + + if(window->base.inner_window) + detach_inner_window(window->base.inner_window); + window->base.inner_window = window->pending_window; + window->pending_window = NULL; +} + HRESULT update_window_doc(HTMLInnerWindow *window) { HTMLOuterWindow *outer_window = window->base.outer_window; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7515fbfd2cd..407e047fb9b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -984,6 +984,7 @@ HRESULT create_document_node(nsIDOMDocument*,GeckoBrowser*,HTMLInnerWindow*, HRESULT create_doctype_node(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**);
HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,HTMLOuterWindow**); +void set_window_uninitialized(HTMLOuterWindow*,HTMLDocumentNode*); HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 870500ff0ab..e4d7f49e99e 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3412,8 +3412,18 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
if(!ref) { if(This->doc_node) { - This->doc_node->doc_obj = NULL; - IHTMLDOMNode_Release(&This->doc_node->node.IHTMLDOMNode_iface); + HTMLDocumentNode *doc_node = This->doc_node; + + /* Protect against re-entry by grabbing it here */ + This->ref++; + set_window_uninitialized(This->window, doc_node); + + This->doc_node = NULL; + doc_node->doc_obj = NULL; + IHTMLDOMNode_Release(&doc_node->node.IHTMLDOMNode_iface); + + /* Since we grabbed it, releasing it here will take care of freeing it */ + return HTMLDocumentObj_Release(&This->IUnknown_inner); } if(This->window) IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface); diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index f972c2a8316..a4b50b91fa6 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -5999,6 +5999,97 @@ static void test_empty_document(void) IHTMLDocument2_Release(doc); }
+static void test_document_close(void) +{ + IHTMLPrivateWindow *priv_window; + IHTMLDocument2 *doc, *doc_node; + IHTMLDocument3 *doc3; + IHTMLWindow2 *window; + IHTMLElement *elem; + HRESULT hres; + BSTR bstr; + + doc = create_document_with_origin(input_doc_str); + if(!doc) + return; + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLPrivateWindow, (void**)&priv_window); + ok(hres == S_OK, "Could not get IHTMLPrivateWindow) interface: %08lx\n", hres); + hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &bstr); + ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"http://winetest.example.org/"), "unexpected address bar: %s\n", wine_dbgstr_w(bstr)); + IHTMLPrivateWindow_Release(priv_window); + SysFreeString(bstr); + + elem = get_elem_id(doc_node, L"inputid"); + IHTMLElement_Release(elem); + + set_client_site(doc, FALSE); + IHTMLDocument2_Release(doc); + + hres = IHTMLWindow2_get_document(window, &doc); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + ok(doc != doc_node, "doc == doc_node\n"); + + hres = IHTMLDocument2_get_readyState(doc_node, &bstr); + ok(hres == S_OK, "get_readyState failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"uninitialized"), "readyState = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLDocument2_get_readyState(doc, &bstr); + ok(hres == S_OK, "get_readyState failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"uninitialized"), "readyState = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLPrivateWindow, (void**)&priv_window); + ok(hres == S_OK, "Could not get IHTMLPrivateWindow) interface: %08lx\n", hres); + hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &bstr); + ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"about:blank"), "unexpected address bar: %s\n", wine_dbgstr_w(bstr)); + IHTMLPrivateWindow_Release(priv_window); + SysFreeString(bstr); + + bstr = SysAllocString(L"inputid"); + doc3 = get_doc3_iface((IUnknown*)doc); + hres = IHTMLDocument3_getElementById(doc3, bstr, &elem); + ok(hres == S_OK, "getElementById returned: %08lx\n", hres); + ok(elem == NULL, "elem != NULL\n"); + IHTMLDocument3_Release(doc3); + SysFreeString(bstr); + + IHTMLDocument2_Release(doc_node); + IHTMLDocument2_Release(doc); + IHTMLWindow2_Release(window); + + doc = create_document(); + if(!doc) + return; + set_client_site(doc, TRUE); + + hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + + set_client_site(doc, FALSE); + IHTMLDocument2_Release(doc); + + hres = IHTMLWindow2_get_document(window, &doc); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + ok(doc != doc_node, "doc == doc_node\n"); + + IHTMLDocument2_Release(doc_node); + IHTMLDocument2_Release(doc); + IHTMLWindow2_Release(window); +} + static void test_storage_events(const char *doc_str) { static struct { @@ -6365,6 +6456,7 @@ START_TEST(events) }
test_empty_document(); + test_document_close(); test_storage_events(empty_doc_str); test_sync_xhr_events(empty_doc_str); if(is_ie9plus) { diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 9874540e973..4db4777dca4 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -8461,10 +8461,12 @@ static void test_doc_domain(IHTMLDocument2 *doc)
static void test_HTMLDocument_http(BOOL with_wbapp) { + IHTMLDocument2 *doc, *doc_node; + IHTMLWindow2 *window; IMoniker *http_mon; - IHTMLDocument2 *doc; - ULONG ref; HRESULT hres; + ULONG ref; + BSTR bstr;
trace("Testing HTMLDocument (http%s)...\n", with_wbapp ? " with IWebBrowserApp" : "");
@@ -8529,12 +8531,42 @@ static void test_HTMLDocument_http(BOOL with_wbapp) test_IsDirty(doc, S_FALSE); test_GetCurMoniker((IUnknown*)doc, NULL, prev_url, support_wbapp);
+ hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + + hres = IHTMLDocument2_get_readyState(doc_node, &bstr); + ok(hres == S_OK, "get_readyState failed: %08lx\n", hres); + todo_wine_if(support_wbapp) + ok(!wcscmp(bstr, support_wbapp ? L"interactive" : L"complete"), "readyState = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + if(view) IOleDocumentView_Release(view); view = NULL;
release_document(doc);
+ hres = IHTMLWindow2_get_document(window, &doc); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + ok(doc != doc_node, "doc == doc_node\n"); + + hres = IHTMLDocument2_get_readyState(doc_node, &bstr); + ok(hres == S_OK, "get_readyState failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"uninitialized"), "readyState = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLDocument2_get_readyState(doc, &bstr); + ok(hres == S_OK, "get_readyState failed: %08lx\n", hres); + ok(!wcscmp(bstr, L"uninitialized"), "readyState = %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + IHTMLDocument2_Release(doc_node); + IHTMLDocument2_Release(doc); + IHTMLWindow2_Release(window); + ref = IMoniker_Release(http_mon); ok(!ref, "ref=%ld, expected 0\n", ref); } diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index dc5dac98ee7..de1fd056169 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -4525,7 +4525,10 @@ static void test_exec_script(IHTMLDocument2 *doc, const WCHAR *codew, const WCHA
static void test_simple_script(void) { + IHTMLDocument2 *doc_node; + IHTMLWindow2 *window; IHTMLDocument2 *doc; + HRESULT hres;
doc = create_document(); if(!doc) @@ -4596,6 +4599,12 @@ static void test_simple_script(void) if(window_dispex) IDispatchEx_Release(window_dispex);
+ hres = IHTMLDocument2_get_parentWindow(doc, &window); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); + + hres = IHTMLWindow2_get_document(window, &doc_node); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + SET_EXPECT(SetScriptState_DISCONNECTED); SET_EXPECT(Close); SET_EXPECT(Close2); @@ -4605,6 +4614,14 @@ static void test_simple_script(void) CHECK_CALLED(SetScriptState_DISCONNECTED); CHECK_CALLED(Close); CHECK_CALLED(Close2); + + hres = IHTMLWindow2_get_document(window, &doc); + ok(hres == S_OK, "get_document failed: %08lx\n", hres); + ok(doc != doc_node, "doc == doc_node\n"); + + IHTMLDocument2_Release(doc_node); + IHTMLDocument2_Release(doc); + IHTMLWindow2_Release(window); }
static void run_from_moniker(IMoniker *mon)
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/navigate.c | 3 +++ dlls/mshtml/tests/events.c | 22 +++++++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index cd888fc3e45..3fc798287bc 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2832,7 +2832,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, FIXME("unimplemented flags %lx\n", flags & ~2);
if(!window || !window->browser) - return E_UNEXPECTED; + return E_FAIL;
if(window->browser->doc->hostui) { hres = IDocHostUIHandler_TranslateUrl(window->browser->doc->hostui, 0, url, &translated_url); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 8172abd8040..cefb6624b67 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -2678,6 +2678,9 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u BSTR display_uri; HRESULT hres;
+ if(!window->browser) + return E_UNEXPECTED; + if(new_url && base_uri) hres = CoInternetCombineUrlEx(base_uri, new_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, &nav_uri, 0); diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index a4b50b91fa6..06c077d996d 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -6003,11 +6003,13 @@ static void test_document_close(void) { IHTMLPrivateWindow *priv_window; IHTMLDocument2 *doc, *doc_node; + IHTMLLocation *location; IHTMLDocument3 *doc3; IHTMLWindow2 *window; IHTMLElement *elem; + BSTR bstr, bstr2; HRESULT hres; - BSTR bstr; + VARIANT v;
doc = create_document_with_origin(input_doc_str); if(!doc) @@ -6087,6 +6089,24 @@ static void test_document_close(void)
IHTMLDocument2_Release(doc_node); IHTMLDocument2_Release(doc); + + bstr = SysAllocString(L"about:blank"); + hres = IHTMLWindow2_get_location(window, &location); + ok(hres == S_OK, "get_location failed: %08lx\n", hres); + hres = IHTMLLocation_put_href(location, bstr); + ok(hres == E_UNEXPECTED, "put_href returned: %08lx\n", hres); + IHTMLLocation_Release(location); + + V_VT(&v) = VT_EMPTY; + bstr2 = SysAllocString(L""); + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLPrivateWindow, (void**)&priv_window); + ok(hres == S_OK, "Could not get IHTMLPrivateWindow) interface: %08lx\n", hres); + hres = IHTMLPrivateWindow_SuperNavigate(priv_window, bstr, bstr2, NULL, NULL, &v, &v, 0); + ok(hres == E_FAIL, "SuperNavigate returned: %08lx\n", hres); + IHTMLPrivateWindow_Release(priv_window); + SysFreeString(bstr2); + SysFreeString(bstr); + IHTMLWindow2_Release(window); }
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=138594
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w7u_adm (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w7u_el (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w8 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w8adm (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w864 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064v1809 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064_tsign (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64_en_AE_u8 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w11pro64 (32 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w7pro64 (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w864 (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064v1809 (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064_2qxl (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064_adm (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w1064_tsign (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64 (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64_ar (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64_ja (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w10pro64_zh_CN (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
=== w11pro64_amd (64 bit report) ===
mshtml: events.c:6097: Test failed: put_href returned: 80004004
Jacek Caban (@jacek) commented about dlls/mshtml/htmlwindow.c:
- if(FAILED(hres))
return;
- nsres = nsIDOMDocument_GetImplementation(doc_node->dom_document, &implementation);
- if(NS_FAILED(nsres))
return;
- nsAString_InitDepend(&nsstr, L"");
- nsres = nsIDOMDOMImplementation_CreateHTMLDocument(implementation, &nsstr, &nsdoc);
- nsIDOMDOMImplementation_Release(implementation);
- nsAString_Finish(&nsstr);
- if(NS_FAILED(nsres))
return;
- hres = create_document_node(nsdoc, window->browser, window->pending_window, COMPAT_MODE_QUIRKS, &window->pending_window->doc);
- nsIDOMDocument_Release(nsdoc);
This seems a bit hackish. The main problem is that those changes are not reflected on Gecko side, so Gecko HTML window will still reference the old document. Maybe we should actually load about:blank instead (possibly by-passing urlmon al letting Gecko take care of it)? Or maybe there is some Gecko API that would do that better?
On Tue Oct 10 13:24:26 2023 +0000, Gabriel Ivăncescu wrote:
OK so let me try another perspective. What do you think about the fourth patch? Obviously, if nothing is holding the inner windows while they're detached, then it should be good to go right? I mean, right now I know that some things can still hold the inner window, mostly because we still pass it to external callers instead of the outer window. But after that's fixed, do you think the fourth patch would be acceptable, then? Tbh I'd want it mainly because I'm interested to see if anything still holds inner window (it shouldn't, in theory). Otherwise, none of that behavior is tested and would be hard to debug if something relies on it. So for now I think I should just drop the 3rd and 4th patch and resend fourth after I have all external callers obtain the outer window. Is that fine? Who knows maybe we find out then that the 3rd is needed after all.
When inner window will be truly internal, then some of those NULL checks may be indeed removed. Note however, that some of them are less than obvious. Navigation may happen in a middle of some other function, possibly with Gecko code involved.
On Wed Oct 11 11:27:24 2023 +0000, Jacek Caban wrote:
This seems a bit hackish. The main problem is that those changes are not reflected on Gecko side, so Gecko HTML window will still reference the old document. Maybe we should actually load about:blank instead (possibly by-passing urlmon al letting Gecko take care of it)? Or maybe there is some Gecko API that would do that better?
Yeah we'll have to bypass all notifications somehow. Also note that this happens synchronously on Windows (the tests don't have any msg loop after doc obj is released), not sure if Gecko has a way to navigate that way?
On Wed Oct 11 12:59:36 2023 +0000, Gabriel Ivăncescu wrote:
Yeah we'll have to bypass all notifications somehow. Also note that this happens synchronously on Windows (the tests don't have any msg loop after doc obj is released), not sure if Gecko has a way to navigate that way?
BTW, does it matter that much if Gecko's window is updated properly? Since navigation is disabled after that on the outer window, and Gecko's document is indeed correctly set here (it's created along with our mshtml document node) so all operations on the doc should be "correct" for an about:blank document. Just the Window won't, but I don't think we're using it?
On Wed Oct 11 16:31:06 2023 +0000, Gabriel Ivăncescu wrote:
BTW, does it matter that much if Gecko's window is updated properly? Since navigation is disabled after that on the outer window, and Gecko's document is indeed correctly set here (it's created along with our mshtml document node) so all operations on the doc should be "correct" for an about:blank document. Just the Window won't, but I don't think we're using it?
Well, does the patch matter in the first place? I thought that your main motivation was to get references right and it's not achieved if Gecko still holds the document, including all its iframes. Creating a document is far from free, so is it worth it in the current shape?
I'd expect that there is way to do that right in Gecko, but I don't know without deeper look at its sources.
On Thu Oct 12 10:44:45 2023 +0000, Jacek Caban wrote:
Well, does the patch matter in the first place? I thought that your main motivation was to get references right and it's not achieved if Gecko still holds the document, including all its iframes. Creating a document is far from free, so is it worth it in the current shape? I'd expect that there is way to do that right in Gecko, but I don't know without deeper look at its sources.
It's needed for further patches dealing with some quirks (with script hosts), to eventually implement MessageEvent.source and such, at least for testing properly.
I've been fiddling quite a bit with synchronous binding but it doesn't seem to actually navigate on Gecko side, I guess I'm missing something, or is that not possible?
On Thu Oct 12 15:31:01 2023 +0000, Gabriel Ivăncescu wrote:
It's needed for further patches dealing with some quirks (with script hosts), to eventually implement MessageEvent.source and such, at least for testing properly. I've been fiddling quite a bit with synchronous binding but it doesn't seem to actually navigate on Gecko side, I guess I'm missing something, or is that not possible?
Actually I think I got it working with a sync binding to about:blank. It passes all the (new) tests, but there's a weird assertion failure in gecko in the htmldoc test about object holding more refs than its refcount… no idea where I messed up, it's not obvious.