From 415542eb7cc514644b884454a044047b742b1652 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 10 Jul 2020 16:15:00 +0000 Subject: [PATCH 1/4] [js] Get the class pointer from the ObjectGroup in NativeObject::slotSpan This changes NativeObject::slotSpan() to get the class from the object group rather than getting it from the base shape to avoid a race between Shape::ensureOwnBaseShape and background sweeping. --- js/src/vm/NativeObject.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index 3a3e50244f..e9c59ff7cd 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -646,7 +646,10 @@ class NativeObject : public ShapedObject uint32_t slotSpan() const { if (inDictionaryMode()) return lastProperty()->base()->slotSpan(); - return lastProperty()->slotSpan(); + + // Get the class from the object group rather than the base shape to avoid a + // race between Shape::ensureOwnBaseShape and background sweeping. + return lastProperty()->slotSpan(getClass()); } /* Whether a slot is at a fixed offset from this object. */ From 8d5005090abb0e8e457dc0bbd86e8c1c5fca732e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 10 Jul 2020 16:52:44 +0000 Subject: [PATCH 2/4] [network] Use query and ref lengths if available in nsStandardURL. --- netwerk/base/nsStandardURL.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 81b4855028..1866c10379 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -2747,12 +2747,16 @@ nsStandardURL::SetFilePath(const nsACString &input) return SetSpec(spec); } - else if (mPath.mLen > 1) { + + if (mPath.mLen > 1) { mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1); // left shift query, and ref ShiftFromQuery(1 - mFilepath.mLen); + // One character for '/', and if we have a query or ref we add their + // length and one extra for each '?' or '#' characters + mPath.mLen = 1 + (mQuery.mLen >= 0 ? (mQuery.mLen + 1) : 0) + + (mRef.mLen >= 0 ? (mRef.mLen + 1) : 0); // these contain only a '/' - mPath.mLen = 1; mDirectory.mLen = 1; mFilepath.mLen = 1; // these are no longer defined From be8bea50ff6d241e052508bade4c6e66a20df1b0 Mon Sep 17 00:00:00 2001 From: Lootyhoof Date: Tue, 9 Jun 2020 21:12:17 +0100 Subject: [PATCH 3/4] [Basilisk] Issue MoonchildProductions/UXP#1578 - Add global menubar support for GTK --- application/basilisk/base/content/browser-menubar.inc | 4 ++++ application/basilisk/base/content/browser.js | 4 ++++ application/basilisk/components/places/content/places.xul | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/application/basilisk/base/content/browser-menubar.inc b/application/basilisk/base/content/browser-menubar.inc index 702c5ec340..04e4634ed0 100644 --- a/application/basilisk/base/content/browser-menubar.inc +++ b/application/basilisk/base/content/browser-menubar.inc @@ -5,7 +5,11 @@ diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 0e4d7978cf..7933b937d1 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -4698,6 +4698,10 @@ function getTogglableToolbars() { let toolbarNodes = Array.slice(gNavToolbox.childNodes); toolbarNodes = toolbarNodes.concat(gNavToolbox.externalToolbars); toolbarNodes = toolbarNodes.filter(node => node.getAttribute("toolbarname")); +#ifdef MOZ_WIDGET_GTK + if (document.documentElement.getAttribute("shellshowingmenubar") == "true") + toolbarNodes = toolbarNodes.filter(node => node.id != "toolbar-menubar"); +#endif return toolbarNodes; } diff --git a/application/basilisk/components/places/content/places.xul b/application/basilisk/components/places/content/places.xul index 16c3385cbf..6d2cdf1712 100644 --- a/application/basilisk/components/places/content/places.xul +++ b/application/basilisk/components/places/content/places.xul @@ -156,8 +156,12 @@ #ifdef XP_MACOSX #else +#endif Date: Fri, 10 Jul 2020 19:09:21 +0000 Subject: [PATCH 4/4] [Basilisk] Issue #17 - Reinstate erroneously removed unload event listener Looks like this was just lazily lumped in with WebExtension stuff and got removed as a result. This should prevent the autorefresh blocker from leaking. --- application/basilisk/base/content/tab-content.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index f66f536fa0..3e0d9d7bc7 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -865,11 +865,13 @@ RefreshBlocker.init(); #ifdef MOZ_WEBEXTENSIONS ExtensionContent.init(this); +#endif addEventListener("unload", () => { +#ifdef MOZ_WEBEXTENSIONS ExtensionContent.uninit(this); +#endif RefreshBlocker.uninit(); }); -#endif addMessageListener("AllowScriptsToClose", () => { content.QueryInterface(Ci.nsIInterfaceRequestor)