lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 21411 discussions
[Git][tpo/applications/tor-browser][tor-browser-153.4.0esr-16.0-1] fixup! BB 41369: Improve Firefox language settings for multi-lingual packages
by Pier Angelo Vendrame (@pierov) 28 Sep '26

28 Sep '26
Pier Angelo Vendrame pushed to branch tor-browser-153.4.0esr-16.0-1 at The Tor Project / Applications / Tor Browser Commits: 8a4083f1 by Pier Angelo Vendrame at 2026-09-28T14:17:44+02:00 fixup! BB 41369: Improve Firefox language settings for multi-lingual packages BB 45360: Move our language setting customization to the new design. - - - - - 2 changed files: - browser/components/preferences/config/languages.mjs - browser/components/preferences/main.js Changes: ===================================== browser/components/preferences/config/languages.mjs ===================================== @@ -56,7 +56,7 @@ export const Multilingual = { /** @type {LocaleCode[]} */ (await LangPackMatcher.getAvailableLocales()), code => code, (code, label) => ({ code, label }) - ); + ).sort((a, b) => (a.code > b.code ? 1 : -1)); }, /** @@ -209,6 +209,20 @@ Preferences.addSetting({ * @returns {SettingOptionConfig} */ function makeBrowserLanguageOption({ code, label }) { + if (code === "ja-JP-macos") { + // Mozilla codebases handle Japanese in macOS in different ways, sometimes + // they call it ja-JP-mac and sometimes they call it ja-JP-macos. + // The former is translated to Japanese when specifying preferNative to + // true, the latter is not. Since seeing ja-JP-macos would be confusing + // anyway, we treat it as a special case. + // See tor-browser#41372 and Bug 1726586. + label = + Services.intl.getLocaleDisplayNames(undefined, ["ja"], { + preferNative: true, + })[0] + " (ja)"; + } else { + label += ` (${code})`; + } return { value: code, controlAttrs: { ===================================== browser/components/preferences/main.js ===================================== @@ -1417,30 +1417,8 @@ var gMainPane = { available, { preferNative: true } ); - let locales = available.map((code, i) => { - let name = localeNames[i].replace(/\s*\(.+\)$/g, ""); - if (code === "ja-JP-macos") { - // Mozilla codebases handle Japanese in macOS in different ways, - // sometimes they call it ja-JP-mac and sometimes they call it - // ja-JP-macos. The former is translated to Japanese when specifying - // preferNative to true, the latter is not. Since seeing ja-JP-macos - // would be confusing anyway, we treat it as a special case. - // See tor-browser#41372 and Bug 1726586. - name = - Services.intl.getLocaleDisplayNames(undefined, ["ja"], { - preferNative: true, - })[0] + " (ja)"; - } else { - name += ` (${code})`; - } - return { - code, - name, - }; - }); - // tor-browser#42335: Sort language codes independently from the locale, - // so do not use localeCompare. - locales.sort((a, b) => a.code > b.code); + let locales = available.map((code, i) => ({ code, name: localeNames[i] })); + locales.sort((a, b) => a.name > b.name); let fragment = document.createDocumentFragment(); for (let { code, name } of locales) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/8a4083f… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/8a4083f… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser] Pushed new tag mullvad-browser-140.17.0esr-15.0-1-build2
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed new tag mullvad-browser-140.17.0esr-15.0-1-build2 at The Tor Project / Applications / Mullvad Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/tree/mullv… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-140.17.0esr-15.0-1] 7 commits: Bug 2056767: Shut down DocAccessibleParents before we shut down platform accessibility. a=pascalc
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed to branch mullvad-browser-140.17.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 02322e29 by James Teh at 2026-09-28T10:43:54+02:00 Bug 2056767: Shut down DocAccessibleParents before we shut down platform accessibility. a=pascalc Original Revision: https://phabricator.services.mozilla.com/D322228 Differential Revision: https://phabricator.services.mozilla.com/D323108 - - - - - 76943803 by Rob Wu at 2026-09-28T10:43:58+02:00 Bug 2061470 - Don't drop __proto__ from webRequest bodies r=rpl Differential Revision: https://phabricator.services.mozilla.com/D323631 - - - - - 357553c1 by Marco Bonardo at 2026-09-28T10:44:03+02:00 Bug 2066019. a=pascalc Original Revision: https://phabricator.services.mozilla.com/D321246 Differential Revision: https://phabricator.services.mozilla.com/D323563 - - - - - 0060fe36 by Tom Schuster at 2026-09-28T10:44:07+02:00 Bug 2066321 - Update nonceable attribute checks for link elements. r=freddyb Pending PR: https://github.com/w3c/webappsec-csp/pull/810 Differential Revision: https://phabricator.services.mozilla.com/D322966 - - - - - 855edaae by Leo Tenenbaum at 2026-09-28T10:44:12+02:00 Bug 2067172 - a=pascalc Original Revision: https://phabricator.services.mozilla.com/D321879 Differential Revision: https://phabricator.services.mozilla.com/D322306 - - - - - ba101997 by Iain Ireland at 2026-09-28T10:44:16+02:00 Bug 2068385: Fix PBL a=pascalc Original Revision: https://phabricator.services.mozilla.com/D323744 Differential Revision: https://phabricator.services.mozilla.com/D324712 - - - - - 59434ea5 by Iain Ireland at 2026-09-28T10:44:19+02:00 Bug 2068385: Don't support sparse arrays in SpreadMathMinMax a=pascalc Marking the testcase --slow because it takes 7+ minutes on my laptop in an opt-debug build. Original Revision: https://phabricator.services.mozilla.com/D323120 Differential Revision: https://phabricator.services.mozilla.com/D324692 - - - - - 14 changed files: - accessible/base/DocManager.cpp - accessible/ipc/DocAccessibleParent.cpp - browser/components/places/content/controller.js - browser/components/places/tests/browser/browser_toolbar_drop_bookmarklet.js - browser/components/places/tests/browser/browser_toolbar_drop_multiple_with_bookmarklet.js - dom/base/nsContentUtils.cpp - dom/script/ScriptLoader.cpp - dom/security/nsContentSecurityUtils.cpp - js/src/jit/BaselineIC.cpp - js/src/jit/CacheIR.cpp - js/src/jit/CacheIRWriter.h - js/src/vm/PortableBaselineInterpret.cpp - toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html - toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs Changes: ===================================== accessible/base/DocManager.cpp ===================================== @@ -31,6 +31,10 @@ #include "nsCoreUtils.h" #include "xpcAccessibleDocument.h" +#if defined(ANDROID) +# include "mozilla/Monitor.h" +#endif + using namespace mozilla; using namespace mozilla::a11y; using namespace mozilla::dom; @@ -195,6 +199,18 @@ void DocManager::Shutdown() { } ClearDocCache(); + // Even though remote documents aren't strictly managed by this DocManager + // instance, destroy them now because they might depend on platform specific + // state which is about to be torn down by PlatformShutdown. Iterate the array + // backwards because destroying the document removes it from this array. + if (sRemoteDocuments) { +#if defined(ANDROID) + MonitorAutoLock mal(nsAccessibilityService::GetAndroidMonitor()); +#endif + for (size_t i = sRemoteDocuments->Length(); i-- > 0;) { + (*sRemoteDocuments)[i]->Destroy(); + } + } } //////////////////////////////////////////////////////////////////////////////// ===================================== accessible/ipc/DocAccessibleParent.cpp ===================================== @@ -1241,15 +1241,14 @@ void DocAccessibleParent::MaybeInitWindowEmulation() { isActive = browserParent->GetDocShellIsActive(); } - // onCreate is guaranteed to be called synchronously by - // nsWinUtils::CreateNativeWindow, so this reference isn't really necessary. - // However, static analysis complains without it. RefPtr<DocAccessibleParent> thisRef = this; - nsWinUtils::NativeWindowCreateProc onCreate([thisRef](HWND aHwnd) -> void { - ::SetPropW(aHwnd, kPropNameDocAccParent, - reinterpret_cast<HANDLE>(thisRef.get())); - thisRef->SetEmulatedWindowHandle(aHwnd); - }); + nsWinUtils::NativeWindowCreateProc onCreate( + [thisRef](HWND aHwnd) mutable -> void { + thisRef->SetEmulatedWindowHandle(aHwnd); + HANDLE val; + thisRef.forget(&val); // Release in SetEmulatedWindowHandle. + ::SetPropW(aHwnd, kPropNameDocAccParent, val); + }); HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow()); DebugOnly<HWND> hWnd = nsWinUtils::CreateNativeWindow( @@ -1261,6 +1260,7 @@ void DocAccessibleParent::MaybeInitWindowEmulation() { void DocAccessibleParent::SetEmulatedWindowHandle(HWND aWindowHandle) { if (!aWindowHandle && mEmulatedWindowHandle && IsTopLevel()) { ::DestroyWindow(mEmulatedWindowHandle); + Release(); // AddRef in MaybeInitWindowEmulation. } mEmulatedWindowHandle = aWindowHandle; } ===================================== browser/components/places/content/controller.js ===================================== @@ -1609,7 +1609,7 @@ var PlacesControllerDragHelper = { if ( !flavor.startsWith("text/x-moz-place") && (validNodes.length > 1 || dropCount > 1) && - validNodes.some(n => n.uri?.startsWith("javascript:")) + validNodes.some(n => URL.parse(n.uri)?.protocol === "javascript:") ) { return false; } @@ -1686,18 +1686,14 @@ var PlacesControllerDragHelper = { if ( externalDrag && (nodes.length > 1 || dropCount > 1) && - nodes.some(n => n.uri?.startsWith("javascript:")) + nodes.some(n => URL.parse(n.uri)?.protocol === "javascript:") ) { throw new Error("Javascript bookmarklet passed with uris"); } // If a single javascript url is being dropped from the urlbar or an external source, // show the bookmark dialog as a speedbump protection against malicious cases. - if ( - nodes.length == 1 && - externalDrag && - nodes[0].uri?.startsWith("javascript") - ) { + if (nodes.length == 1 && externalDrag) { let uri; try { uri = Services.io.newURI(nodes[0].uri); @@ -1705,7 +1701,7 @@ var PlacesControllerDragHelper = { // Invalid uri, we skip this code and the entry will be discarded later. } - if (uri) { + if (uri?.scheme === "javascript") { let bookmarkGuid = await PlacesUIUtils.showBookmarkDialog( { action: "add", ===================================== browser/components/places/tests/browser/browser_toolbar_drop_bookmarklet.js ===================================== @@ -9,6 +9,7 @@ const sandbox = sinon.createSandbox(); const URL1 = "https://example.com/1/"; const URL2 = "https://example.com/2/"; const BOOKMARKLET_URL = `javascript: (() => {alert('Hello, World!');})();`; +const BOOKMARKLET_URL_MIXED_CASE = `JavaScript: (() => {})();`; let bookmarks; registerCleanupFunction(async function () { @@ -34,12 +35,18 @@ add_task(async function test() { Assert.ok(placesItems, "PlacesToolbarItems should not be null"); /** - * Simulates a drop of a bookmarklet URI onto the bookmarks bar. + * Simulates a drop of a bookmarklet URI onto the bookmarks bar and verifies + * the speedbump dialog appears. * * @param {string} aEffect * The effect to use for the drop operation: move, copy, or link. + * @param {string} aBookmarkletUrl + * The bookmarklet URL to be dropped onto the bookmarks bar. */ - let simulateDragDrop = async function (aEffect) { + let simulateBookmarkletDragDrop = async function ( + aEffect, + aBookmarkletUrl = BOOKMARKLET_URL + ) { info("Simulates drag/drop of a new javascript:URL to the bookmarks"); await withBookmarksDialog( true, @@ -47,7 +54,7 @@ add_task(async function test() { EventUtils.synthesizeDrop( toolbar, placesItems, - [[{ type: "text/x-moz-url", data: BOOKMARKLET_URL }]], + [[{ type: "text/x-moz-url", data: aBookmarkletUrl }]], aEffect, window ); @@ -61,11 +68,21 @@ add_task(async function test() { Assert.equal( location, - BOOKMARKLET_URL, + aBookmarkletUrl.trim().replace(/^javascript/i, "javascript"), "Should have opened the ShowBookmarksDialog with the correct bookmarklet url to be bookmarked" ); } ); + }; + + for (let effect of ["copy", "link"]) { + for (let bookmarkletUrl of [ + BOOKMARKLET_URL, + BOOKMARKLET_URL_MIXED_CASE, + ` javascript: (() => {})();`, + ]) { + await simulateBookmarkletDragDrop(effect, bookmarkletUrl); + } info("Simulates drag/drop of a new URL to the bookmarks"); let spy = sandbox @@ -81,18 +98,13 @@ add_task(async function test() { toolbar, placesItems, [[{ type: "text/x-moz-url", data: URL1 }]], - aEffect, + effect, window ); await promise; Assert.ok(spy.notCalled, "ShowBookmarksDialog on drop not called for url"); sandbox.restore(); - }; - - let effects = ["copy", "link"]; - for (let effect of effects) { - await simulateDragDrop(effect); } info("Move of existing bookmark / bookmarklet on toolbar"); ===================================== browser/components/places/tests/browser/browser_toolbar_drop_multiple_with_bookmarklet.js ===================================== @@ -18,12 +18,12 @@ add_task(async function test() { // matter because we will set its data, effect, and mimeType manually. let placesItems = document.getElementById("PlacesToolbarItems"); Assert.ok(placesItems, "PlacesToolbarItems should not be null"); - let simulateDragDrop = async function (aEffect, aMimeType) { - let urls = [ - "https://example.com/1/", - `javascript: (() => {alert('Hello, World!');})();`, - "https://example.com/2/", - ]; + let simulateDragDrop = async function ( + aEffect, + aMimeType, + aJsUrl = `javascript: (() => {alert('Hello, World!');})();` + ) { + let urls = ["https://example.com/1/", aJsUrl, "https://example.com/2/"]; let data = urls.map(spec => spec + "\n" + spec).join("\n"); @@ -43,8 +43,13 @@ add_task(async function test() { // Simulate a bookmark drop for all of the mime types and effects. let mimeType = ["text/x-moz-url"]; - let effects = ["copy", "link"]; - for (let effect of effects) { - await simulateDragDrop(effect, mimeType); + for (let effect of ["copy", "link"]) { + for (let jsUrl of [ + `javascript: (() => {alert('Hello, World!');})();`, + `JavaScript: (() => {})();`, + ` javascript: (() => {})();`, + ]) { + await simulateDragDrop(effect, mimeType, jsUrl); + } } }); ===================================== dom/base/nsContentUtils.cpp ===================================== @@ -5635,9 +5635,10 @@ void nsContentUtils::RequestFrameFocus(Element& aFrameElement, bool aCanRaise, RefPtr<Element> target = &aFrameElement; bool defaultAction = true; if (aCanRaise) { - DispatchEventOnlyToChrome(target->OwnerDoc(), target, - u"framefocusrequested"_ns, CanBubble::eYes, - Cancelable::eYes, &defaultAction); + RefPtr<Document> doc = target->OwnerDoc(); + DispatchEventOnlyToChrome(doc, target, u"framefocusrequested"_ns, + CanBubble::eYes, Cancelable::eYes, + &defaultAction); } if (!defaultAction) { return; ===================================== dom/script/ScriptLoader.cpp ===================================== @@ -240,27 +240,27 @@ ScriptLoader::~ScriptLoader() { FireScriptAvailable(NS_ERROR_ABORT, mParserBlockingRequest); } - for (ScriptLoadRequest* req = mXSLTRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mXSLTRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mDeferRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mDeferRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mLoadingAsyncRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mLoadedAsyncRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mLoadedAsyncRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = + for (RefPtr<ScriptLoadRequest> req = mNonAsyncExternalScriptInsertedRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); ===================================== dom/security/nsContentSecurityUtils.cpp ===================================== @@ -1176,8 +1176,9 @@ nsString nsContentSecurityUtils::GetIsElementNonceableNonce( // element’s attribute list: if (nsCOMPtr<nsIScriptElement> script = do_QueryInterface(const_cast<Element*>(&aElement))) { - auto containsScriptOrStyle = [](const nsAString& aStr) { - return aStr.LowerCaseFindASCII("<script") != kNotFound || + auto containsLinkScriptOrStyle = [](const nsAString& aStr) { + return aStr.LowerCaseFindASCII("<link") != kNotFound || + aStr.LowerCaseFindASCII("<script") != kNotFound || aStr.LowerCaseFindASCII("<style") != kNotFound; }; @@ -1185,21 +1186,21 @@ nsString nsContentSecurityUtils::GetIsElementNonceableNonce( uint32_t i = 0; while (BorrowedAttrInfo info = aElement.GetAttrInfoAt(i++)) { // Step 2.1. If attribute’s name contains an ASCII case-insensitive match - // for "<script" or "<style", return "Not Nonceable". + // for "<link", <script" or "<style", return "Not Nonceable". const nsAttrName* name = info.mName; if (nsAtom* prefix = name->GetPrefix()) { - if (containsScriptOrStyle(nsDependentAtomString(prefix))) { + if (containsLinkScriptOrStyle(nsDependentAtomString(prefix))) { return EmptyString(); } } - if (containsScriptOrStyle(nsDependentAtomString(name->LocalName()))) { + if (containsLinkScriptOrStyle(nsDependentAtomString(name->LocalName()))) { return EmptyString(); } // Step 2.2. If attribute’s value contains an ASCII case-insensitive match - // for "<script" or "<style", return "Not Nonceable". + // for "<link", "<script" or "<style", return "Not Nonceable". info.mValue->ToString(value); - if (containsScriptOrStyle(value)) { + if (containsLinkScriptOrStyle(value)) { return EmptyString(); } } ===================================== js/src/jit/BaselineIC.cpp ===================================== @@ -1735,10 +1735,15 @@ bool DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame, // Transition stub state to megamorphic or generic if warranted. MaybeTransition(cx, frame, stub); + // The array is required to be packed, but may have indexed properties + // if its length exceeds MAX_DENSE_ELEMENTS_COUNT. Don't optimize in + // that case. + bool isIndexed = arr.toObject().as<NativeObject>().isIndexed(); + // Try attaching a call stub. bool handled = false; if (op != JSOp::SpreadEval && op != JSOp::StrictSpreadEval && - stub->state().canAttachStub()) { + stub->state().canAttachStub() && !isIndexed) { // Try CacheIR first: Rooted<ArrayObject*> aobj(cx, &arr.toObject().as<ArrayObject>()); MOZ_ASSERT(IsPackedArray(aobj)); ===================================== js/src/jit/CacheIR.cpp ===================================== @@ -6431,7 +6431,9 @@ ObjOperandId InlinableNativeIRGenerator::emitLoadArgsArray() { MOZ_ASSERT(!hasBoundArguments()); if (flags_.getArgFormat() == CallFlags::Spread) { - return writer.loadSpreadArgs(); + ObjOperandId result = writer.loadSpreadArgs(); + writer.guardArrayIsPacked(result); + return result; } MOZ_ASSERT(flags_.getArgFormat() == CallFlags::FunApplyArray); ===================================== js/src/jit/CacheIRWriter.h ===================================== @@ -523,7 +523,13 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter { ArgumentKind kind = ArgumentKind::Arg0; uint32_t argc = 1; CallFlags flags(CallFlags::Spread); - return ObjOperandId(loadArgumentFixedSlot(kind, argc, flags).id()); + ValOperandId argId = loadArgumentFixedSlot(kind, argc, flags); +#ifdef ENABLE_PORTABLE_BASELINE_INTERP + // PBL doesn't support implicit unboxing of objects. + return guardToObject(argId); +#else + return ObjOperandId(argId.id()); +#endif } void callScriptedFunction(ObjOperandId callee, Int32OperandId argc, ===================================== js/src/vm/PortableBaselineInterpret.cpp ===================================== @@ -3915,11 +3915,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, CACHEOP_CASE(Int32MinMaxArrayResult) { ObjOperandId arrayId = cacheIRReader.objOperandId(); bool isMax = cacheIRReader.readBool(); - // ICs that use this opcode depend on implicit unboxing due to - // type-overload on ObjOperandId when a value is loaded - // directly from an argument slot. We explicitly unbox here. NativeObject* nobj = reinterpret_cast<NativeObject*>( - &READ_VALUE_REG(arrayId.id()).toObject()); + READ_REG(arrayId.id())); uint32_t len = nobj->getDenseInitializedLength(); if (len == 0) { FAIL_IC(); @@ -3948,11 +3945,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, CACHEOP_CASE(NumberMinMaxArrayResult) { ObjOperandId arrayId = cacheIRReader.objOperandId(); bool isMax = cacheIRReader.readBool(); - // ICs that use this opcode depend on implicit unboxing due to - // type-overload on ObjOperandId when a value is loaded - // directly from an argument slot. We explicitly unbox here. NativeObject* nobj = reinterpret_cast<NativeObject*>( - &READ_VALUE_REG(arrayId.id()).toObject()); + READ_REG(arrayId.id())); uint32_t len = nobj->getDenseInitializedLength(); if (len == 0) { FAIL_IC(); ===================================== toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html ===================================== @@ -27,6 +27,7 @@ enctype="multipart/form-data" > <input type="text" name="textInput2" value="value2"> +<input type="text" name="__proto__" value="regression test for bug 2061470"> <input type="file" name="testFile"> <input type="file" name="emptyFile"> </form> @@ -161,11 +162,19 @@ add_task(async function test_xhr_forms() { } let action = new URL(form.action); let formData = new FormData(form); - let webRequestFD = {}; let updateActionURL = () => { + let webRequestFD = {}; for (let name of formData.keys()) { - webRequestFD[name] = name in uploads ? [uploads[name].fileName] : formData.getAll(name); + if (Object.hasOwn(webRequestFD, name)) { + // Ignore duplicate keys; formData.getAll already read all values. + continue; + } + const value = Object.hasOwn(uploads, name) ? [uploads[name].fileName] : formData.getAll(name); + // Cannot use webRequestFD[name] = value, because for "__proto__" as + // name, that would trigger the Object.prototype.__proto__ setter + // instead of defining a data property. + Object.defineProperty(webRequestFD, name, { value, enumerable: true }); } action.searchParams.set("upload", JSON.stringify(webRequestFD)); action.searchParams.set("enctype", form.enctype); ===================================== toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs ===================================== @@ -117,22 +117,6 @@ class Headers extends Map { } } -/** - * Creates a new Object with a corresponding property for every - * key-value pair in the given Map. - * - * @param {Map} map - * The map to convert. - * @returns {object} - */ -function mapToObject(map) { - let result = {}; - for (let [key, value] of map) { - result[key] = value; - } - return result; -} - /** * Rewinds the given seekable input stream to its beginning, and catches * any resulting errors. @@ -446,7 +430,7 @@ function createFormData(stream, channel, lenient) { try { let formData = parseFormData(stream, channel, lenient); if (formData) { - return mapToObject(formData); + return Object.fromEntries(formData); } } catch (e) { Cu.reportError(e); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/61… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/61… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser] Pushed new tag mullvad-browser-153.4.0esr-16.0-1-build2
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed new tag mullvad-browser-153.4.0esr-16.0-1-build2 at The Tor Project / Applications / Mullvad Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/tree/mullv… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-153.4.0esr-16.0-1] 2 commits: Bug 2054384 - Download notifications should truncate long filenames in the...
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed to branch mullvad-browser-153.4.0esr-16.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 4a1b9e9d by giorga at 2026-09-28T10:41:39+02:00 Bug 2054384 - Download notifications should truncate long filenames in the middle. r=android-reviewers,tthibaud Differential Revision: https://phabricator.services.mozilla.com/D321546 - - - - - 4065ff08 by Rob Wu at 2026-09-28T10:41:44+02:00 Bug 2061470 - Don't drop __proto__ from webRequest bodies r=rpl Differential Revision: https://phabricator.services.mozilla.com/D323631 - - - - - 6 changed files: - mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadNotification.kt - mobile/android/android-components/components/feature/downloads/src/test/java/mozilla/components/feature/downloads/DownloadNotificationTest.kt - mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt - mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt - toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html - toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs Changes: ===================================== mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadNotification.kt ===================================== @@ -28,6 +28,7 @@ import mozilla.components.feature.downloads.AbstractFetchDownloadService.Compani import mozilla.components.feature.downloads.AbstractFetchDownloadService.Companion.ACTION_RESUME import mozilla.components.feature.downloads.AbstractFetchDownloadService.Companion.ACTION_TRY_AGAIN import mozilla.components.feature.downloads.AbstractFetchDownloadService.DownloadJobState +import mozilla.components.support.ktx.kotlin.truncateMiddle import mozilla.components.support.utils.DownloadFileUtils import kotlin.random.Random import kotlin.time.Duration.Companion.seconds @@ -40,6 +41,7 @@ internal object DownloadNotification { internal const val NOTIFICATION_DOWNLOAD_GROUP_ID = 100 private const val LEGACY_NOTIFICATION_CHANNEL_ID = "Downloads" internal const val PERCENTAGE_MULTIPLIER = 100 + private const val MAX_FILENAME_LENGTH = 25 @VisibleForTesting internal fun createDownloadGroupNotification( @@ -89,11 +91,12 @@ internal object DownloadNotification { val channelId = ensureChannelExists(context) val isIndeterminate = downloadState.isIndeterminate() val percentCopied = downloadState.getPercent() ?: -1 + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setStyle( NotificationCompat.BigTextStyle() - .setBigContentTitle(downloadState.fileName.orEmpty()) + .setBigContentTitle(fileName) .setSummaryText( formatDownloadTimeRemaining( context = context, @@ -105,10 +108,8 @@ internal object DownloadNotification { ), ) .setSmallIcon(R.drawable.mozac_feature_download_ic_ongoing_download) - .setContentTitle(downloadState.fileName.orEmpty()) - .setContentText( - downloadState.getProgress(fileSizeFormatter = fileSizeFormatter), - ) + .setContentTitle(fileName) + .setContentText(downloadState.getProgress(fileSizeFormatter = fileSizeFormatter)) .setColor(ContextCompat.getColor(context, notificationAccentColor)) .setCategory(NotificationCompat.CATEGORY_PROGRESS) .setProgress(PERCENTAGE_MULTIPLIER, percentCopied, isIndeterminate) @@ -132,10 +133,11 @@ internal object DownloadNotification { notificationAccentColor: Int, ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setContentText( context.applicationContext.getString(R.string.mozac_feature_downloads_paused_notification_text), ) @@ -163,10 +165,11 @@ internal object DownloadNotification { contentIntent: PendingIntent = createOpenFilePendingIntent(context, downloadState, downloadFileUtils), ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download_complete) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setWhen(createdTime) .setOnlyAlertOnce(true) .setContentText( @@ -191,10 +194,11 @@ internal object DownloadNotification { notificationAccentColor: Int, ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download_failed) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setContentText( context.applicationContext.getString(R.string.mozac_feature_downloads_failed_notification_text2), ) @@ -217,7 +221,8 @@ internal object DownloadNotification { notifications: List<DownloadJobState>, ): List<String> { return notifications.take(2).map { downloadState -> - "${downloadState.state.fileName} ${downloadState.state.getStatusDescription( + val fileName = downloadState.state.fileName.orEmpty().truncateMiddle(MAX_FILENAME_LENGTH) + "$fileName ${downloadState.state.getStatusDescription( context = context, fileSizeFormatter = fileSizeFormatter, )}" ===================================== mobile/android/android-components/components/feature/downloads/src/test/java/mozilla/components/feature/downloads/DownloadNotificationTest.kt ===================================== @@ -4,6 +4,7 @@ package mozilla.components.feature.downloads +import android.app.Notification import android.app.PendingIntent import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat.EXTRA_PROGRESS @@ -307,6 +308,32 @@ class DownloadNotificationTest { assertEquals(true, notificationDownloadWithNoSize.extras.getBoolean(EXTRA_PROGRESS_INDETERMINATE)) } + @Test + fun `createOngoingDownloadNotification with long filename truncates from middle`() { + val longFileName = "this_is_a_very_long_filename_that_exceeds_forty_characters_to_test_truncation.pdf" + val downloadState = + DownloadState( + fileName = longFileName, + url = "mozilla.org/file.pdf", + contentLength = 100L, + currentBytesCopied = 10, + status = DownloadState.Status.DOWNLOADING, + ) + val style = AbstractFetchDownloadService.Style() + + val notification = + DownloadNotification.createOngoingDownloadNotification( + context = testContext, + downloadState = downloadState, + fileSizeFormatter = fakeFileSizeFormatter, + notificationAccentColor = style.notificationAccentColor, + downloadEstimator = DownloadEstimator(dateTimeProvider = FakeDateTimeProvider()), + ) + + val expectedTitle = "this_is_a_ve…uncation.pdf" + assertEquals(expectedTitle, notification.extras.getCharSequence(Notification.EXTRA_TITLE).toString()) + } + @Test fun getOngoingNotificationAccentColor() { val download = DownloadJobState( ===================================== mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt ===================================== @@ -498,3 +498,24 @@ internal fun String.extractBase6RawString(): String? { contentString } } + +/** + * Truncates the string from the middle if it exceeds [maxLength]. + * + * @param maxLength The maximum length of the string. + * @param ellipsis The string to use as ellipsis, defaults to "…". + * @return The truncated string. + */ +fun String.truncateMiddle(maxLength: Int, ellipsis: String = "…"): String { + if (length <= maxLength) { + return this + } + if (maxLength <= ellipsis.length) { + return take(maxLength) + } + + val half = (maxLength - ellipsis.length) / 2 + val start = take(half) + val end = takeLast(maxLength - ellipsis.length - half) + return "$start$ellipsis$end" +} ===================================== mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt ===================================== @@ -306,6 +306,16 @@ class StringTest { } } + @Test + fun truncateMiddle() { + assertEquals("123…890", "1234567890".truncateMiddle(7)) + assertEquals("1234567890", "1234567890".truncateMiddle(10)) + assertEquals("1234567890", "1234567890".truncateMiddle(20)) + assertEquals("1…0", "1234567890".truncateMiddle(3)) + assertEquals("1", "1234567890".truncateMiddle(1)) + assertEquals("123...890", "1234567890".truncateMiddle(9, "...")) + } + @Test fun `WHEN a string contains utf 8 encoded characters or illegal filename characters decode decodes it`() { // List of pairs of encoded strings or illegal filename characters and their expected decoded results ===================================== toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html ===================================== @@ -27,6 +27,7 @@ enctype="multipart/form-data" > <input type="text" name="textInput2" value="value2"> +<input type="text" name="__proto__" value="regression test for bug 2061470"> <input type="file" name="testFile"> <input type="file" name="emptyFile"> </form> @@ -161,11 +162,19 @@ add_task(async function test_xhr_forms() { } let action = new URL(form.action); let formData = new FormData(form); - let webRequestFD = {}; let updateActionURL = () => { + let webRequestFD = {}; for (let name of formData.keys()) { - webRequestFD[name] = name in uploads ? [uploads[name].fileName] : formData.getAll(name); + if (Object.hasOwn(webRequestFD, name)) { + // Ignore duplicate keys; formData.getAll already read all values. + continue; + } + const value = Object.hasOwn(uploads, name) ? [uploads[name].fileName] : formData.getAll(name); + // Cannot use webRequestFD[name] = value, because for "__proto__" as + // name, that would trigger the Object.prototype.__proto__ setter + // instead of defining a data property. + Object.defineProperty(webRequestFD, name, { value, enumerable: true }); } action.searchParams.set("upload", JSON.stringify(webRequestFD)); action.searchParams.set("enctype", form.enctype); ===================================== toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs ===================================== @@ -117,22 +117,6 @@ class Headers extends Map { } } -/** - * Creates a new Object with a corresponding property for every - * key-value pair in the given Map. - * - * @param {Map} map - * The map to convert. - * @returns {object} - */ -function mapToObject(map) { - let result = {}; - for (let [key, value] of map) { - result[key] = value; - } - return result; -} - /** * Rewinds the given seekable input stream to its beginning, and catches * any resulting errors. @@ -446,7 +430,7 @@ function createFormData(stream, channel, lenient) { try { let formData = parseFormData(stream, channel, lenient); if (formData) { - return mapToObject(formData); + return Object.fromEntries(formData); } } catch (e) { Cu.reportError(e); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/58… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/58… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser-build][main] Bump Firefox version to 153.4.0esr for nightly builds.
by Pier Angelo Vendrame (@pierov) 28 Sep '26

28 Sep '26
Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: 357441c3 by Pier Angelo Vendrame at 2026-09-28T10:28:24+02:00 Bump Firefox version to 153.4.0esr for nightly builds. - - - - - 2 changed files: - projects/firefox/config - projects/geckoview/config Changes: ===================================== projects/firefox/config ===================================== @@ -18,12 +18,12 @@ container: use_container: 1 var: - firefox_platform_version: '153.3.0' + firefox_platform_version: '153.4.0' firefox_version: '[% c("var/firefox_platform_version") %]esr' browser_series: '16.0' browser_rebase: 1 browser_branch: '[% c("var/browser_series") %]-[% c("var/browser_rebase") %]' - browser_build: 2 + browser_build: 1 upstream_firefox_commit: FIREFOX_NIGHTLY_153_END copyright_year: '[% exec("git show -s --format=%ci " _ c("git_hash") _ "^{commit}", { exec_noco => 1 }).remove("-.*") %]' nightly_updates_publish_dir: '[% c("var/nightly_updates_publish_dir_prefix") %]nightly-[% c("var/osname") %]' ===================================== projects/geckoview/config ===================================== @@ -21,12 +21,12 @@ container: build_apk: '[% !c("var/online_build") %]' var: - firefox_platform_version: '153.3.0' + firefox_platform_version: '153.4.0' geckoview_version: '[% c("var/firefox_platform_version") %]esr' browser_series: '16.0' browser_rebase: 1 browser_branch: '[% c("var/browser_series") %]-[% c("var/browser_rebase") %]' - browser_build: 2 + browser_build: 1 gitlab_project: https://gitlab.torproject.org/tpo/applications/tor-browser git_commit: '[% exec("git rev-parse " _ c("git_hash") _ "^{commit}", { exec_noco => 1 }) %]' deps: View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser] Pushed new tag tor-browser-153.4.0esr-16.0-1-build2
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed new tag tor-browser-153.4.0esr-16.0-1-build2 at The Tor Project / Applications / Tor Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-153.4.0esr-16.0-1] 2 commits: Bug 2054384 - Download notifications should truncate long filenames in the...
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed to branch tor-browser-153.4.0esr-16.0-1 at The Tor Project / Applications / Tor Browser Commits: 5bdc9fc9 by giorga at 2026-09-26T19:19:21+02:00 Bug 2054384 - Download notifications should truncate long filenames in the middle. r=android-reviewers,tthibaud Differential Revision: https://phabricator.services.mozilla.com/D321546 - - - - - 2b4271f7 by Rob Wu at 2026-09-27T17:17:54+02:00 Bug 2061470 - Don't drop __proto__ from webRequest bodies r=rpl Differential Revision: https://phabricator.services.mozilla.com/D323631 - - - - - 6 changed files: - mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadNotification.kt - mobile/android/android-components/components/feature/downloads/src/test/java/mozilla/components/feature/downloads/DownloadNotificationTest.kt - mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt - mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt - toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html - toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs Changes: ===================================== mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadNotification.kt ===================================== @@ -28,6 +28,7 @@ import mozilla.components.feature.downloads.AbstractFetchDownloadService.Compani import mozilla.components.feature.downloads.AbstractFetchDownloadService.Companion.ACTION_RESUME import mozilla.components.feature.downloads.AbstractFetchDownloadService.Companion.ACTION_TRY_AGAIN import mozilla.components.feature.downloads.AbstractFetchDownloadService.DownloadJobState +import mozilla.components.support.ktx.kotlin.truncateMiddle import mozilla.components.support.utils.DownloadFileUtils import kotlin.random.Random import kotlin.time.Duration.Companion.seconds @@ -40,6 +41,7 @@ internal object DownloadNotification { internal const val NOTIFICATION_DOWNLOAD_GROUP_ID = 100 private const val LEGACY_NOTIFICATION_CHANNEL_ID = "Downloads" internal const val PERCENTAGE_MULTIPLIER = 100 + private const val MAX_FILENAME_LENGTH = 25 @VisibleForTesting internal fun createDownloadGroupNotification( @@ -89,11 +91,12 @@ internal object DownloadNotification { val channelId = ensureChannelExists(context) val isIndeterminate = downloadState.isIndeterminate() val percentCopied = downloadState.getPercent() ?: -1 + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setStyle( NotificationCompat.BigTextStyle() - .setBigContentTitle(downloadState.fileName.orEmpty()) + .setBigContentTitle(fileName) .setSummaryText( formatDownloadTimeRemaining( context = context, @@ -105,10 +108,8 @@ internal object DownloadNotification { ), ) .setSmallIcon(R.drawable.mozac_feature_download_ic_ongoing_download) - .setContentTitle(downloadState.fileName.orEmpty()) - .setContentText( - downloadState.getProgress(fileSizeFormatter = fileSizeFormatter), - ) + .setContentTitle(fileName) + .setContentText(downloadState.getProgress(fileSizeFormatter = fileSizeFormatter)) .setColor(ContextCompat.getColor(context, notificationAccentColor)) .setCategory(NotificationCompat.CATEGORY_PROGRESS) .setProgress(PERCENTAGE_MULTIPLIER, percentCopied, isIndeterminate) @@ -132,10 +133,11 @@ internal object DownloadNotification { notificationAccentColor: Int, ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setContentText( context.applicationContext.getString(R.string.mozac_feature_downloads_paused_notification_text), ) @@ -163,10 +165,11 @@ internal object DownloadNotification { contentIntent: PendingIntent = createOpenFilePendingIntent(context, downloadState, downloadFileUtils), ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download_complete) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setWhen(createdTime) .setOnlyAlertOnce(true) .setContentText( @@ -191,10 +194,11 @@ internal object DownloadNotification { notificationAccentColor: Int, ): Notification { val channelId = ensureChannelExists(context) + val fileName = downloadState.fileName?.truncateMiddle(MAX_FILENAME_LENGTH).orEmpty() return NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.mozac_feature_download_ic_download_failed) - .setContentTitle(downloadState.fileName) + .setContentTitle(fileName) .setContentText( context.applicationContext.getString(R.string.mozac_feature_downloads_failed_notification_text2), ) @@ -217,7 +221,8 @@ internal object DownloadNotification { notifications: List<DownloadJobState>, ): List<String> { return notifications.take(2).map { downloadState -> - "${downloadState.state.fileName} ${downloadState.state.getStatusDescription( + val fileName = downloadState.state.fileName.orEmpty().truncateMiddle(MAX_FILENAME_LENGTH) + "$fileName ${downloadState.state.getStatusDescription( context = context, fileSizeFormatter = fileSizeFormatter, )}" ===================================== mobile/android/android-components/components/feature/downloads/src/test/java/mozilla/components/feature/downloads/DownloadNotificationTest.kt ===================================== @@ -4,6 +4,7 @@ package mozilla.components.feature.downloads +import android.app.Notification import android.app.PendingIntent import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat.EXTRA_PROGRESS @@ -307,6 +308,32 @@ class DownloadNotificationTest { assertEquals(true, notificationDownloadWithNoSize.extras.getBoolean(EXTRA_PROGRESS_INDETERMINATE)) } + @Test + fun `createOngoingDownloadNotification with long filename truncates from middle`() { + val longFileName = "this_is_a_very_long_filename_that_exceeds_forty_characters_to_test_truncation.pdf" + val downloadState = + DownloadState( + fileName = longFileName, + url = "mozilla.org/file.pdf", + contentLength = 100L, + currentBytesCopied = 10, + status = DownloadState.Status.DOWNLOADING, + ) + val style = AbstractFetchDownloadService.Style() + + val notification = + DownloadNotification.createOngoingDownloadNotification( + context = testContext, + downloadState = downloadState, + fileSizeFormatter = fakeFileSizeFormatter, + notificationAccentColor = style.notificationAccentColor, + downloadEstimator = DownloadEstimator(dateTimeProvider = FakeDateTimeProvider()), + ) + + val expectedTitle = "this_is_a_ve…uncation.pdf" + assertEquals(expectedTitle, notification.extras.getCharSequence(Notification.EXTRA_TITLE).toString()) + } + @Test fun getOngoingNotificationAccentColor() { val download = DownloadJobState( ===================================== mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt ===================================== @@ -507,3 +507,24 @@ internal fun String.extractBase6RawString(): String? { contentString } } + +/** + * Truncates the string from the middle if it exceeds [maxLength]. + * + * @param maxLength The maximum length of the string. + * @param ellipsis The string to use as ellipsis, defaults to "…". + * @return The truncated string. + */ +fun String.truncateMiddle(maxLength: Int, ellipsis: String = "…"): String { + if (length <= maxLength) { + return this + } + if (maxLength <= ellipsis.length) { + return take(maxLength) + } + + val half = (maxLength - ellipsis.length) / 2 + val start = take(half) + val end = takeLast(maxLength - ellipsis.length - half) + return "$start$ellipsis$end" +} ===================================== mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt ===================================== @@ -306,6 +306,16 @@ class StringTest { } } + @Test + fun truncateMiddle() { + assertEquals("123…890", "1234567890".truncateMiddle(7)) + assertEquals("1234567890", "1234567890".truncateMiddle(10)) + assertEquals("1234567890", "1234567890".truncateMiddle(20)) + assertEquals("1…0", "1234567890".truncateMiddle(3)) + assertEquals("1", "1234567890".truncateMiddle(1)) + assertEquals("123...890", "1234567890".truncateMiddle(9, "...")) + } + @Test fun `WHEN a string contains utf 8 encoded characters or illegal filename characters decode decodes it`() { // List of pairs of encoded strings or illegal filename characters and their expected decoded results ===================================== toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html ===================================== @@ -27,6 +27,7 @@ enctype="multipart/form-data" > <input type="text" name="textInput2" value="value2"> +<input type="text" name="__proto__" value="regression test for bug 2061470"> <input type="file" name="testFile"> <input type="file" name="emptyFile"> </form> @@ -161,11 +162,19 @@ add_task(async function test_xhr_forms() { } let action = new URL(form.action); let formData = new FormData(form); - let webRequestFD = {}; let updateActionURL = () => { + let webRequestFD = {}; for (let name of formData.keys()) { - webRequestFD[name] = name in uploads ? [uploads[name].fileName] : formData.getAll(name); + if (Object.hasOwn(webRequestFD, name)) { + // Ignore duplicate keys; formData.getAll already read all values. + continue; + } + const value = Object.hasOwn(uploads, name) ? [uploads[name].fileName] : formData.getAll(name); + // Cannot use webRequestFD[name] = value, because for "__proto__" as + // name, that would trigger the Object.prototype.__proto__ setter + // instead of defining a data property. + Object.defineProperty(webRequestFD, name, { value, enumerable: true }); } action.searchParams.set("upload", JSON.stringify(webRequestFD)); action.searchParams.set("enctype", form.enctype); ===================================== toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs ===================================== @@ -117,22 +117,6 @@ class Headers extends Map { } } -/** - * Creates a new Object with a corresponding property for every - * key-value pair in the given Map. - * - * @param {Map} map - * The map to convert. - * @returns {object} - */ -function mapToObject(map) { - let result = {}; - for (let [key, value] of map) { - result[key] = value; - } - return result; -} - /** * Rewinds the given seekable input stream to its beginning, and catches * any resulting errors. @@ -446,7 +430,7 @@ function createFormData(stream, channel, lenient) { try { let formData = parseFormData(stream, channel, lenient); if (formData) { - return mapToObject(formData); + return Object.fromEntries(formData); } } catch (e) { Cu.reportError(e); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/4590f5… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/4590f5… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser] Pushed new tag tor-browser-140.17.0esr-15.0-1-build2
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed new tag tor-browser-140.17.0esr-15.0-1-build2 at The Tor Project / Applications / Tor Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-140.17.0esr-15.0-1] 7 commits: Bug 2056767: Shut down DocAccessibleParents before we shut down platform accessibility. a=pascalc
by ma1 (@ma1) 28 Sep '26

28 Sep '26
ma1 pushed to branch tor-browser-140.17.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 19837410 by James Teh at 2026-09-27T15:56:21+02:00 Bug 2056767: Shut down DocAccessibleParents before we shut down platform accessibility. a=pascalc Original Revision: https://phabricator.services.mozilla.com/D322228 Differential Revision: https://phabricator.services.mozilla.com/D323108 - - - - - eca99650 by Rob Wu at 2026-09-27T17:19:00+02:00 Bug 2061470 - Don't drop __proto__ from webRequest bodies r=rpl Differential Revision: https://phabricator.services.mozilla.com/D323631 - - - - - bddd4de4 by Marco Bonardo at 2026-09-27T17:30:36+02:00 Bug 2066019. a=pascalc Original Revision: https://phabricator.services.mozilla.com/D321246 Differential Revision: https://phabricator.services.mozilla.com/D323563 - - - - - e8ce3fe3 by Tom Schuster at 2026-09-27T17:32:19+02:00 Bug 2066321 - Update nonceable attribute checks for link elements. r=freddyb Pending PR: https://github.com/w3c/webappsec-csp/pull/810 Differential Revision: https://phabricator.services.mozilla.com/D322966 - - - - - 5fd1f7de by Leo Tenenbaum at 2026-09-27T17:41:10+02:00 Bug 2067172 - a=pascalc Original Revision: https://phabricator.services.mozilla.com/D321879 Differential Revision: https://phabricator.services.mozilla.com/D322306 - - - - - 43f705a3 by Iain Ireland at 2026-09-27T18:23:46+02:00 Bug 2068385: Fix PBL a=pascalc Original Revision: https://phabricator.services.mozilla.com/D323744 Differential Revision: https://phabricator.services.mozilla.com/D324712 - - - - - b6746e50 by Iain Ireland at 2026-09-28T10:08:52+02:00 Bug 2068385: Don't support sparse arrays in SpreadMathMinMax a=pascalc Marking the testcase --slow because it takes 7+ minutes on my laptop in an opt-debug build. Original Revision: https://phabricator.services.mozilla.com/D323120 Differential Revision: https://phabricator.services.mozilla.com/D324692 - - - - - 14 changed files: - accessible/base/DocManager.cpp - accessible/ipc/DocAccessibleParent.cpp - browser/components/places/content/controller.js - browser/components/places/tests/browser/browser_toolbar_drop_bookmarklet.js - browser/components/places/tests/browser/browser_toolbar_drop_multiple_with_bookmarklet.js - dom/base/nsContentUtils.cpp - dom/script/ScriptLoader.cpp - dom/security/nsContentSecurityUtils.cpp - js/src/jit/BaselineIC.cpp - js/src/jit/CacheIR.cpp - js/src/jit/CacheIRWriter.h - js/src/vm/PortableBaselineInterpret.cpp - toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html - toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs Changes: ===================================== accessible/base/DocManager.cpp ===================================== @@ -31,6 +31,10 @@ #include "nsCoreUtils.h" #include "xpcAccessibleDocument.h" +#if defined(ANDROID) +# include "mozilla/Monitor.h" +#endif + using namespace mozilla; using namespace mozilla::a11y; using namespace mozilla::dom; @@ -195,6 +199,18 @@ void DocManager::Shutdown() { } ClearDocCache(); + // Even though remote documents aren't strictly managed by this DocManager + // instance, destroy them now because they might depend on platform specific + // state which is about to be torn down by PlatformShutdown. Iterate the array + // backwards because destroying the document removes it from this array. + if (sRemoteDocuments) { +#if defined(ANDROID) + MonitorAutoLock mal(nsAccessibilityService::GetAndroidMonitor()); +#endif + for (size_t i = sRemoteDocuments->Length(); i-- > 0;) { + (*sRemoteDocuments)[i]->Destroy(); + } + } } //////////////////////////////////////////////////////////////////////////////// ===================================== accessible/ipc/DocAccessibleParent.cpp ===================================== @@ -1241,15 +1241,14 @@ void DocAccessibleParent::MaybeInitWindowEmulation() { isActive = browserParent->GetDocShellIsActive(); } - // onCreate is guaranteed to be called synchronously by - // nsWinUtils::CreateNativeWindow, so this reference isn't really necessary. - // However, static analysis complains without it. RefPtr<DocAccessibleParent> thisRef = this; - nsWinUtils::NativeWindowCreateProc onCreate([thisRef](HWND aHwnd) -> void { - ::SetPropW(aHwnd, kPropNameDocAccParent, - reinterpret_cast<HANDLE>(thisRef.get())); - thisRef->SetEmulatedWindowHandle(aHwnd); - }); + nsWinUtils::NativeWindowCreateProc onCreate( + [thisRef](HWND aHwnd) mutable -> void { + thisRef->SetEmulatedWindowHandle(aHwnd); + HANDLE val; + thisRef.forget(&val); // Release in SetEmulatedWindowHandle. + ::SetPropW(aHwnd, kPropNameDocAccParent, val); + }); HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow()); DebugOnly<HWND> hWnd = nsWinUtils::CreateNativeWindow( @@ -1261,6 +1260,7 @@ void DocAccessibleParent::MaybeInitWindowEmulation() { void DocAccessibleParent::SetEmulatedWindowHandle(HWND aWindowHandle) { if (!aWindowHandle && mEmulatedWindowHandle && IsTopLevel()) { ::DestroyWindow(mEmulatedWindowHandle); + Release(); // AddRef in MaybeInitWindowEmulation. } mEmulatedWindowHandle = aWindowHandle; } ===================================== browser/components/places/content/controller.js ===================================== @@ -1610,7 +1610,7 @@ var PlacesControllerDragHelper = { if ( !flavor.startsWith("text/x-moz-place") && (validNodes.length > 1 || dropCount > 1) && - validNodes.some(n => n.uri?.startsWith("javascript:")) + validNodes.some(n => URL.parse(n.uri)?.protocol === "javascript:") ) { return false; } @@ -1687,18 +1687,14 @@ var PlacesControllerDragHelper = { if ( externalDrag && (nodes.length > 1 || dropCount > 1) && - nodes.some(n => n.uri?.startsWith("javascript:")) + nodes.some(n => URL.parse(n.uri)?.protocol === "javascript:") ) { throw new Error("Javascript bookmarklet passed with uris"); } // If a single javascript url is being dropped from the urlbar or an external source, // show the bookmark dialog as a speedbump protection against malicious cases. - if ( - nodes.length == 1 && - externalDrag && - nodes[0].uri?.startsWith("javascript") - ) { + if (nodes.length == 1 && externalDrag) { let uri; try { uri = Services.io.newURI(nodes[0].uri); @@ -1706,7 +1702,7 @@ var PlacesControllerDragHelper = { // Invalid uri, we skip this code and the entry will be discarded later. } - if (uri) { + if (uri?.scheme === "javascript") { let bookmarkGuid = await PlacesUIUtils.showBookmarkDialog( { action: "add", ===================================== browser/components/places/tests/browser/browser_toolbar_drop_bookmarklet.js ===================================== @@ -9,6 +9,7 @@ const sandbox = sinon.createSandbox(); const URL1 = "https://example.com/1/"; const URL2 = "https://example.com/2/"; const BOOKMARKLET_URL = `javascript: (() => {alert('Hello, World!');})();`; +const BOOKMARKLET_URL_MIXED_CASE = `JavaScript: (() => {})();`; let bookmarks; registerCleanupFunction(async function () { @@ -34,12 +35,18 @@ add_task(async function test() { Assert.ok(placesItems, "PlacesToolbarItems should not be null"); /** - * Simulates a drop of a bookmarklet URI onto the bookmarks bar. + * Simulates a drop of a bookmarklet URI onto the bookmarks bar and verifies + * the speedbump dialog appears. * * @param {string} aEffect * The effect to use for the drop operation: move, copy, or link. + * @param {string} aBookmarkletUrl + * The bookmarklet URL to be dropped onto the bookmarks bar. */ - let simulateDragDrop = async function (aEffect) { + let simulateBookmarkletDragDrop = async function ( + aEffect, + aBookmarkletUrl = BOOKMARKLET_URL + ) { info("Simulates drag/drop of a new javascript:URL to the bookmarks"); await withBookmarksDialog( true, @@ -47,7 +54,7 @@ add_task(async function test() { EventUtils.synthesizeDrop( toolbar, placesItems, - [[{ type: "text/x-moz-url", data: BOOKMARKLET_URL }]], + [[{ type: "text/x-moz-url", data: aBookmarkletUrl }]], aEffect, window ); @@ -61,11 +68,21 @@ add_task(async function test() { Assert.equal( location, - BOOKMARKLET_URL, + aBookmarkletUrl.trim().replace(/^javascript/i, "javascript"), "Should have opened the ShowBookmarksDialog with the correct bookmarklet url to be bookmarked" ); } ); + }; + + for (let effect of ["copy", "link"]) { + for (let bookmarkletUrl of [ + BOOKMARKLET_URL, + BOOKMARKLET_URL_MIXED_CASE, + ` javascript: (() => {})();`, + ]) { + await simulateBookmarkletDragDrop(effect, bookmarkletUrl); + } info("Simulates drag/drop of a new URL to the bookmarks"); let spy = sandbox @@ -81,18 +98,13 @@ add_task(async function test() { toolbar, placesItems, [[{ type: "text/x-moz-url", data: URL1 }]], - aEffect, + effect, window ); await promise; Assert.ok(spy.notCalled, "ShowBookmarksDialog on drop not called for url"); sandbox.restore(); - }; - - let effects = ["copy", "link"]; - for (let effect of effects) { - await simulateDragDrop(effect); } info("Move of existing bookmark / bookmarklet on toolbar"); ===================================== browser/components/places/tests/browser/browser_toolbar_drop_multiple_with_bookmarklet.js ===================================== @@ -18,12 +18,12 @@ add_task(async function test() { // matter because we will set its data, effect, and mimeType manually. let placesItems = document.getElementById("PlacesToolbarItems"); Assert.ok(placesItems, "PlacesToolbarItems should not be null"); - let simulateDragDrop = async function (aEffect, aMimeType) { - let urls = [ - "https://example.com/1/", - `javascript: (() => {alert('Hello, World!');})();`, - "https://example.com/2/", - ]; + let simulateDragDrop = async function ( + aEffect, + aMimeType, + aJsUrl = `javascript: (() => {alert('Hello, World!');})();` + ) { + let urls = ["https://example.com/1/", aJsUrl, "https://example.com/2/"]; let data = urls.map(spec => spec + "\n" + spec).join("\n"); @@ -43,8 +43,13 @@ add_task(async function test() { // Simulate a bookmark drop for all of the mime types and effects. let mimeType = ["text/x-moz-url"]; - let effects = ["copy", "link"]; - for (let effect of effects) { - await simulateDragDrop(effect, mimeType); + for (let effect of ["copy", "link"]) { + for (let jsUrl of [ + `javascript: (() => {alert('Hello, World!');})();`, + `JavaScript: (() => {})();`, + ` javascript: (() => {})();`, + ]) { + await simulateDragDrop(effect, mimeType, jsUrl); + } } }); ===================================== dom/base/nsContentUtils.cpp ===================================== @@ -5635,9 +5635,10 @@ void nsContentUtils::RequestFrameFocus(Element& aFrameElement, bool aCanRaise, RefPtr<Element> target = &aFrameElement; bool defaultAction = true; if (aCanRaise) { - DispatchEventOnlyToChrome(target->OwnerDoc(), target, - u"framefocusrequested"_ns, CanBubble::eYes, - Cancelable::eYes, &defaultAction); + RefPtr<Document> doc = target->OwnerDoc(); + DispatchEventOnlyToChrome(doc, target, u"framefocusrequested"_ns, + CanBubble::eYes, Cancelable::eYes, + &defaultAction); } if (!defaultAction) { return; ===================================== dom/script/ScriptLoader.cpp ===================================== @@ -240,27 +240,27 @@ ScriptLoader::~ScriptLoader() { FireScriptAvailable(NS_ERROR_ABORT, mParserBlockingRequest); } - for (ScriptLoadRequest* req = mXSLTRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mXSLTRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mDeferRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mDeferRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mLoadingAsyncRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = mLoadedAsyncRequests.getFirst(); req; + for (RefPtr<ScriptLoadRequest> req = mLoadedAsyncRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); } - for (ScriptLoadRequest* req = + for (RefPtr<ScriptLoadRequest> req = mNonAsyncExternalScriptInsertedRequests.getFirst(); req; req = req->getNext()) { FireScriptAvailable(NS_ERROR_ABORT, req); ===================================== dom/security/nsContentSecurityUtils.cpp ===================================== @@ -1179,8 +1179,9 @@ nsString nsContentSecurityUtils::GetIsElementNonceableNonce( // element’s attribute list: if (nsCOMPtr<nsIScriptElement> script = do_QueryInterface(const_cast<Element*>(&aElement))) { - auto containsScriptOrStyle = [](const nsAString& aStr) { - return aStr.LowerCaseFindASCII("<script") != kNotFound || + auto containsLinkScriptOrStyle = [](const nsAString& aStr) { + return aStr.LowerCaseFindASCII("<link") != kNotFound || + aStr.LowerCaseFindASCII("<script") != kNotFound || aStr.LowerCaseFindASCII("<style") != kNotFound; }; @@ -1188,21 +1189,21 @@ nsString nsContentSecurityUtils::GetIsElementNonceableNonce( uint32_t i = 0; while (BorrowedAttrInfo info = aElement.GetAttrInfoAt(i++)) { // Step 2.1. If attribute’s name contains an ASCII case-insensitive match - // for "<script" or "<style", return "Not Nonceable". + // for "<link", <script" or "<style", return "Not Nonceable". const nsAttrName* name = info.mName; if (nsAtom* prefix = name->GetPrefix()) { - if (containsScriptOrStyle(nsDependentAtomString(prefix))) { + if (containsLinkScriptOrStyle(nsDependentAtomString(prefix))) { return EmptyString(); } } - if (containsScriptOrStyle(nsDependentAtomString(name->LocalName()))) { + if (containsLinkScriptOrStyle(nsDependentAtomString(name->LocalName()))) { return EmptyString(); } // Step 2.2. If attribute’s value contains an ASCII case-insensitive match - // for "<script" or "<style", return "Not Nonceable". + // for "<link", "<script" or "<style", return "Not Nonceable". info.mValue->ToString(value); - if (containsScriptOrStyle(value)) { + if (containsLinkScriptOrStyle(value)) { return EmptyString(); } } ===================================== js/src/jit/BaselineIC.cpp ===================================== @@ -1735,10 +1735,15 @@ bool DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame, // Transition stub state to megamorphic or generic if warranted. MaybeTransition(cx, frame, stub); + // The array is required to be packed, but may have indexed properties + // if its length exceeds MAX_DENSE_ELEMENTS_COUNT. Don't optimize in + // that case. + bool isIndexed = arr.toObject().as<NativeObject>().isIndexed(); + // Try attaching a call stub. bool handled = false; if (op != JSOp::SpreadEval && op != JSOp::StrictSpreadEval && - stub->state().canAttachStub()) { + stub->state().canAttachStub() && !isIndexed) { // Try CacheIR first: Rooted<ArrayObject*> aobj(cx, &arr.toObject().as<ArrayObject>()); MOZ_ASSERT(IsPackedArray(aobj)); ===================================== js/src/jit/CacheIR.cpp ===================================== @@ -6431,7 +6431,9 @@ ObjOperandId InlinableNativeIRGenerator::emitLoadArgsArray() { MOZ_ASSERT(!hasBoundArguments()); if (flags_.getArgFormat() == CallFlags::Spread) { - return writer.loadSpreadArgs(); + ObjOperandId result = writer.loadSpreadArgs(); + writer.guardArrayIsPacked(result); + return result; } MOZ_ASSERT(flags_.getArgFormat() == CallFlags::FunApplyArray); ===================================== js/src/jit/CacheIRWriter.h ===================================== @@ -523,7 +523,13 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter { ArgumentKind kind = ArgumentKind::Arg0; uint32_t argc = 1; CallFlags flags(CallFlags::Spread); - return ObjOperandId(loadArgumentFixedSlot(kind, argc, flags).id()); + ValOperandId argId = loadArgumentFixedSlot(kind, argc, flags); +#ifdef ENABLE_PORTABLE_BASELINE_INTERP + // PBL doesn't support implicit unboxing of objects. + return guardToObject(argId); +#else + return ObjOperandId(argId.id()); +#endif } void callScriptedFunction(ObjOperandId callee, Int32OperandId argc, ===================================== js/src/vm/PortableBaselineInterpret.cpp ===================================== @@ -3915,11 +3915,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, CACHEOP_CASE(Int32MinMaxArrayResult) { ObjOperandId arrayId = cacheIRReader.objOperandId(); bool isMax = cacheIRReader.readBool(); - // ICs that use this opcode depend on implicit unboxing due to - // type-overload on ObjOperandId when a value is loaded - // directly from an argument slot. We explicitly unbox here. NativeObject* nobj = reinterpret_cast<NativeObject*>( - &READ_VALUE_REG(arrayId.id()).toObject()); + READ_REG(arrayId.id())); uint32_t len = nobj->getDenseInitializedLength(); if (len == 0) { FAIL_IC(); @@ -3948,11 +3945,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, CACHEOP_CASE(NumberMinMaxArrayResult) { ObjOperandId arrayId = cacheIRReader.objOperandId(); bool isMax = cacheIRReader.readBool(); - // ICs that use this opcode depend on implicit unboxing due to - // type-overload on ObjOperandId when a value is loaded - // directly from an argument slot. We explicitly unbox here. NativeObject* nobj = reinterpret_cast<NativeObject*>( - &READ_VALUE_REG(arrayId.id()).toObject()); + READ_REG(arrayId.id())); uint32_t len = nobj->getDenseInitializedLength(); if (len == 0) { FAIL_IC(); ===================================== toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html ===================================== @@ -27,6 +27,7 @@ enctype="multipart/form-data" > <input type="text" name="textInput2" value="value2"> +<input type="text" name="__proto__" value="regression test for bug 2061470"> <input type="file" name="testFile"> <input type="file" name="emptyFile"> </form> @@ -161,11 +162,19 @@ add_task(async function test_xhr_forms() { } let action = new URL(form.action); let formData = new FormData(form); - let webRequestFD = {}; let updateActionURL = () => { + let webRequestFD = {}; for (let name of formData.keys()) { - webRequestFD[name] = name in uploads ? [uploads[name].fileName] : formData.getAll(name); + if (Object.hasOwn(webRequestFD, name)) { + // Ignore duplicate keys; formData.getAll already read all values. + continue; + } + const value = Object.hasOwn(uploads, name) ? [uploads[name].fileName] : formData.getAll(name); + // Cannot use webRequestFD[name] = value, because for "__proto__" as + // name, that would trigger the Object.prototype.__proto__ setter + // instead of defining a data property. + Object.defineProperty(webRequestFD, name, { value, enumerable: true }); } action.searchParams.set("upload", JSON.stringify(webRequestFD)); action.searchParams.set("enctype", form.enctype); ===================================== toolkit/components/extensions/webrequest/WebRequestUpload.sys.mjs ===================================== @@ -117,22 +117,6 @@ class Headers extends Map { } } -/** - * Creates a new Object with a corresponding property for every - * key-value pair in the given Map. - * - * @param {Map} map - * The map to convert. - * @returns {object} - */ -function mapToObject(map) { - let result = {}; - for (let [key, value] of map) { - result[key] = value; - } - return result; -} - /** * Rewinds the given seekable input stream to its beginning, and catches * any resulting errors. @@ -446,7 +430,7 @@ function createFormData(stream, channel, lenient) { try { let formData = parseFormData(stream, channel, lenient); if (formData) { - return mapToObject(formData); + return Object.fromEntries(formData); } } catch (e) { Cu.reportError(e); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/67c9d2… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/67c9d2… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • ...
  • 2142
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.