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 -----
  • 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
  • 20430 discussions
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] BB 44865: Block requests to chrome://*/locale.
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: c9fe2594 by Pier Angelo Vendrame at 2026-04-16T19:36:16+02:00 BB 44865: Block requests to chrome://*/locale. - - - - - 1 changed file: - caps/nsScriptSecurityManager.cpp Changes: ===================================== caps/nsScriptSecurityManager.cpp ===================================== @@ -1104,6 +1104,12 @@ nsresult nsScriptSecurityManager::CheckLoadURIFlags( return NS_OK; } } else if (targetScheme.EqualsLiteral("chrome")) { + nsAutoCString path; + if (NS_SUCCEEDED(aTargetURI->GetPathQueryRef(path)) && + StringBeginsWith(path, "/locale/"_ns)) { + return NS_ERROR_DOM_BAD_URI; + } + // Allow the load only if the chrome package is allowlisted. nsCOMPtr<nsIXULChromeRegistry> reg( do_GetService(NS_CHROMEREGISTRY_CONTRACTID)); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c9fe259… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c9fe259… 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-149.0a1-16.0-2] fixup! TB 27476: Implement about:torconnect captive portal within Tor Browser
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 0c255cf8 by Pier Angelo Vendrame at 2026-04-16T19:24:49+02:00 fixup! TB 27476: Implement about:torconnect captive portal within Tor Browser TB 44846: Make sure redirect to about:torconnect works with felt-privacy TB 44798: Exempt iframes from about:torconnect redirects - - - - - 1 changed file: - toolkit/content/aboutNetError.mjs Changes: ===================================== toolkit/content/aboutNetError.mjs ===================================== @@ -379,7 +379,7 @@ function initOnionError() { } // Returns pageTitleId, bodyTitle, bodyTitleId, and longDesc as an object -async function initTitleAndBodyIds(baseURL, isTRROnlyFailure) { +function initTitleAndBodyIds(baseURL, isTRROnlyFailure) { let bodyTitle = document.querySelector(".title-text"); let longDesc = document.getElementById("errorLongDesc"); const tryAgain = document.getElementById("netErrorButtonContainer"); @@ -475,22 +475,12 @@ async function initTitleAndBodyIds(baseURL, isTRROnlyFailure) { learnMore.hidden = false; document.body.className = "certerror"; break; - - case "proxyConnectFailure": - if (await RPMSendQuery("ShouldShowTorConnect")) { - // pass orginal destination as redirect param - const encodedRedirect = encodeURIComponent(document.location.href); - document.location.replace( - `about:torconnect?redirect=${encodedRedirect}` - ); - } - break; } return { pageTitleId, bodyTitle, bodyTitleId, longDesc }; } -async function initPage() { +function initPage() { // We show an offline support page in case of a system-wide error, // when a user cannot connect to the internet and access the SUMO website. // For example, clock error, which causes certerrors across the web or @@ -561,8 +551,10 @@ async function initPage() { tryAgain.hidden = false; const learnMoreLink = document.getElementById("learnMoreLink"); learnMoreLink.setAttribute("href", baseURL + "connection-not-secure"); - let { pageTitleId, bodyTitle, bodyTitleId, longDesc } = - await initTitleAndBodyIds(baseURL, isTRROnlyFailure); + let { pageTitleId, bodyTitle, bodyTitleId, longDesc } = initTitleAndBodyIds( + baseURL, + isTRROnlyFailure + ); // We can handle the offline page separately. if (gNoConnectivity) { @@ -1411,6 +1403,24 @@ async function init() { i++; errorCode = await retryErrorCode(); } + + if (!errorCode) { + errorCode = gErrorCode; + } + if (errorCode === "proxyConnectFailure") { + let inIframe; + try { + inIframe = window.self !== window.top; + } catch { + // Assume a frame if access to top is blocked. + inIframe = true; + } + if (!inIframe && (await RPMSendQuery("ShouldShowTorConnect"))) { + // pass orginal destination as redirect param + const encodedRedirect = encodeURIComponent(document.location.href); + document.location.replace(`about:torconnect?redirect=${encodedRedirect}`); + } + } } async function main() { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/0c255cf… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/0c255cf… 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-149.0a1-16.0-2] 4 commits: fixup! TB 23247: Communicating security expectations for .onion
by henry (@henry) 16 Apr '26

16 Apr '26
henry pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: bddfb109 by Henry Wilkes at 2026-04-16T16:25:52+00:00 fixup! TB 23247: Communicating security expectations for .onion TB 43857: Drop TODO since it is "won't do". - - - - - 184592ac by Henry Wilkes at 2026-04-16T16:25:52+00:00 fixup! TB 43564: Modify ./mach bootstrap for Tor Browser TB 43857: Drop TODO since it is "won't do". - - - - - 112b814b by Henry Wilkes at 2026-04-16T16:25:52+00:00 fixup! [android] Disable features and functionality TB 43857: Drop TODO since it is "won't do". - - - - - 8956c706 by Henry Wilkes at 2026-04-16T16:25:52+00:00 fixup! TB 42247: Android helpers for the TorProvider TB 43857: Update TODO and FIXME comments. - - - - - 4 changed files: - browser/base/content/browser-siteIdentity.js - build/moz.configure/torbrowser-resources.configure - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/intent/HomeDeepLinkIntentProcessor.kt - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java Changes: ===================================== browser/base/content/browser-siteIdentity.js ===================================== @@ -929,7 +929,6 @@ var gIdentityHandler = { uriIsOnionHost ? "onionMixedDisplayContent" : "mixedDisplayContent" ); } else { - // TODO: ignore weak https cipher for onionsites? this._identityBox.classList.add("weakCipher"); } } else if (this._isCertErrorPage) { ===================================== build/moz.configure/torbrowser-resources.configure ===================================== @@ -24,7 +24,6 @@ option( def tor_expert_bundle(value, mozbuild_state_path, _bootstrapped): if value: path = Path(value[0]) - # TODO: Do a more thorough check on the directory. if path.is_dir(): return value[0] else: ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/intent/HomeDeepLinkIntentProcessor.kt ===================================== @@ -133,10 +133,6 @@ class HomeDeepLinkIntentProcessor( } if (BuildConfig.DEEP_LINK_SCHEME.startsWith("torbrowser")) { // tor-browser#42578 - // TODO: - // Maybe just warn users about linkability but - // give them the choice to open anyway, once - // the other deep link related issues are fixed. logger.info("Tor Browser rejects open intent deep link: $deepLink") return } ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java ===================================== @@ -148,7 +148,14 @@ public class TorAndroidIntegration implements BundleEventListener { } else if (EVENT_SETTINGS_CHANGED.equals(event)) { GeckoBundle newSettings = message.getBundle("settings"); if (newSettings != null) { - // TODO: Should we notify listeners? + // NOTE: We assume that we do not need to notify any consumer with the + // new state because we expect the relevant consumers to read the latest + // state regularly (e.g. each time the settings screen is opened), and + // we only expect one active consumer at any given moment (only one + // setting screen is shown) which means that the single consumer can + // reflect any *expected* individual changes in the UI prior to this + // confirmation signal, and there are no other consumers that need to be + // synchronised with this change. See tor-browser#42384. mSettings = new TorSettings(newSettings); } else { Log.w(TAG, "Ignoring a settings changed event that did not have the new settings."); @@ -345,7 +352,7 @@ public class TorAndroidIntegration implements BundleEventListener { data.putInt("status", 0xdeadbeef); } // FIXME: We usually don't reach this when the application is killed! - // So, we don't do our cleanup. + // So, we don't do our cleanup. Investigation in tor-browser#44861. Log.i(TAG, "Tor process " + mHandle + " has exited."); EventDispatcher.getInstance().dispatch(EVENT_TOR_EXITED, data); } View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/723952… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/723952… 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-149.0a1-16.0-2] fixup! BB 43322: Customize the font visibility lists.
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch mullvad-browser-149.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser Commits: db14782c by Pier Angelo Vendrame at 2026-04-16T17:45:14+02:00 fixup! BB 43322: Customize the font visibility lists. BB 44862: Add Segoe MDL2 Assets to fontvis. - - - - - 1 changed file: - gfx/thebes/StandardFonts-win10-bb.inc Changes: ===================================== gfx/thebes/StandardFonts-win10-bb.inc ===================================== @@ -16,6 +16,7 @@ static const char* kBaseFonts[] = { "MS Gothic", "MS PGothic", "MV Boli", + "Segoe MDL2 Assets", "Segoe UI", "SimSun", "Sylfaen", View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/db1… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/db1… 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-149.0a1-16.0-2] fixup! BB 43322: Customize the font visibility lists.
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 723952b8 by Pier Angelo Vendrame at 2026-04-16T17:43:14+02:00 fixup! BB 43322: Customize the font visibility lists. BB 44862: Add Segoe MDL2 Assets to fontvis. - - - - - 1 changed file: - gfx/thebes/StandardFonts-win10-bb.inc Changes: ===================================== gfx/thebes/StandardFonts-win10-bb.inc ===================================== @@ -16,6 +16,7 @@ static const char* kBaseFonts[] = { "MS Gothic", "MS PGothic", "MV Boli", + "Segoe MDL2 Assets", "Segoe UI", "SimSun", "Sylfaen", View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/723952b… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/723952b… 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-149.0a1-16.0-2] fixup! Add CI for Tor Browser
by brizental (@brizental) 16 Apr '26

16 Apr '26
brizental pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: fbfc2288 by Beatriz Rizental at 2026-04-16T11:40:32-03:00 fixup! Add CI for Tor Browser Bug 44860: Add a container with Android toolchains - - - - - 3 changed files: - .gitlab-ci.yml - .gitlab/ci/containers/base/Containerfile - .gitlab/ci/jobs/update-containers.yml Changes: ===================================== .gitlab-ci.yml ===================================== @@ -6,7 +6,7 @@ stages: - update-translations variables: - IMAGE_PATH: containers.torproject.org/tpo/applications/tor-browser/base:latest + IMAGE_PATH: containers.torproject.org/tpo/applications/tor-browser/desktop:latest LOCAL_REPO_PATH: /srv/apps-repos/tor-browser.git include: ===================================== .gitlab/ci/containers/base/Containerfile ===================================== @@ -1,23 +1,39 @@ -# This image is published in containers.torproject.org/tpo/applications/tor-browser/base +# This image is published in containers.torproject.org/tpo/applications/tor-browser/{android,desktop} # -# Whenever there are changes to this file, -# they are autopublished on merge to the tpo/applications/tor-browser repository. -# -# The image is updated roughly once a month when the tor-browser repository is rebased. +# This image is built and published on CI. The CI job that does this is manual, +# therefore it's up to the developer or reviewer to trigger this CI job when necessary +# e.g. after a RR rebase or big changes to this file. FROM containers.torproject.org/tpo/tpa/base-images/python:trixie +ARG APPLICATION_CHOICE + RUN apt-get update && apt-get install -y \ + curl \ git \ - xvfb + libc6-dev \ + xvfb \ + zlib1g-dev RUN git clone --single-branch --depth 1 https://gitlab.torproject.org/tpo/applications/tor-browser.git # Bootstrap will download and install all dependencies required for building / linting / etc. RUN cd tor-browser && \ - yes | MOZBUILD_STATE_PATH=/var/tmp/mozbuild ./mach bootstrap --application-choice "Tor Browser for Desktop" && \ + yes | MOZBUILD_STATE_PATH=/var/tmp/mozbuild ./mach bootstrap --application-choice "$APPLICATION_CHOICE" && \ cd .. +ENV PATH="/var/tmp/mozbuild/clang/bin:/root/.cargo/bin:$PATH" + +RUN echo "$APPLICATION_CHOICE" | grep -qi android && \ + rustup target add armv7-linux-androideabi \ + aarch64-linux-android \ + i686-linux-android \ + x86_64-linux-android \ + || true + RUN rm -rf tor-browser && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/tmp/mozbuild/toolchains && \ + rm -rf /var/tmp/mozbuild/indices && \ + rm -rf /var/tmp/mozbuild/android-device ===================================== .gitlab/ci/jobs/update-containers.yml ===================================== @@ -1,11 +1,17 @@ -build-base-image: +build-image: stage: update-container-images interruptible: true image: containers.torproject.org/tpo/tpa/base-images/podman:bookworm + parallel: + matrix: + - PLATFORM: desktop + APPLICATION_CHOICE: "Tor Browser for Desktop" + - PLATFORM: android + APPLICATION_CHOICE: "GeckoView/Tor Browser for Android" script: - - export TAG="${CI_REGISTRY_IMAGE}/base:latest" + - export TAG="${CI_REGISTRY_IMAGE}/${PLATFORM}:latest" - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - podman build --layers=false $IMAGE -t ${TAG} -f .gitlab/ci/containers/base/Containerfile . + - podman build --layers=false $IMAGE -t ${TAG} --build-arg APPLICATION_CHOICE="${APPLICATION_CHOICE}" -f .gitlab/ci/containers/base/Containerfile . - | echo -e "\e[33mPushing new image to registry as ${TAG}\e[0m" podman push ${TAG} View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/fbfc228… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/fbfc228… 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.10.0esr-15.0-1] fixup! BB 40926: Implemented the New Identity feature
by ma1 (@ma1) 16 Apr '26

16 Apr '26
ma1 pushed to branch mullvad-browser-140.10.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: d9d20a24 by hackademix at 2026-04-16T13:10:07+02:00 fixup! BB 40926: Implemented the New Identity feature BB 44288: Regression, custom home page not blocked anymore on new identity. - - - - - 2 changed files: - browser/components/newidentity/content/newidentity.js - browser/modules/BrowserWindowTracker.sys.mjs Changes: ===================================== browser/components/newidentity/content/newidentity.js ===================================== @@ -402,7 +402,8 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { const isCustomHome = Services.prefs.getIntPref("browser.startup.page") === 1; const win = OpenBrowserWindow({ - private: isCustomHome && isTrustedHome ? "private" : "no-home", + private: true, + skipCustomHome: !(isCustomHome && isTrustedHome), }); // This mechanism to know when the new window is ready is used by // OpenBrowserWindow itself (see its definition in browser.js). @@ -435,7 +436,7 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { } const callback = () => { Services.prefs.setStringPref(trustedHomePref, homeURL); - win.BrowserHome(); + win.BrowserCommands.home(); }; const notificationBox = win.gBrowser.getNotificationBox(); notificationBox.appendNotification( ===================================== browser/modules/BrowserWindowTracker.sys.mjs ===================================== @@ -296,6 +296,7 @@ export const BrowserWindowTracker = { args = null, remote = undefined, fission = undefined, + skipCustomHome = false, } = {}) { let windowFeatures = "chrome,dialog=no,all"; if (features) { @@ -306,7 +307,7 @@ export const BrowserWindowTracker = { windowFeatures += ",private"; if ( (!args && !lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) || - args?.private === "no-home" + skipCustomHome ) { // Force the new window to load about:privatebrowsing instead of the // default home page. View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/d9d… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/d9d… 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.10.0esr-15.0-1] fixup! BB 40926: Implemented the New Identity feature
by ma1 (@ma1) 16 Apr '26

16 Apr '26
ma1 pushed to branch tor-browser-140.10.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 1fb85f39 by hackademix at 2026-04-16T09:30:39+02:00 fixup! BB 40926: Implemented the New Identity feature BB 44288: Regression, custom home page not blocked anymore on new identity. - - - - - 2 changed files: - browser/components/newidentity/content/newidentity.js - browser/modules/BrowserWindowTracker.sys.mjs Changes: ===================================== browser/components/newidentity/content/newidentity.js ===================================== @@ -402,7 +402,8 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { const isCustomHome = Services.prefs.getIntPref("browser.startup.page") === 1; const win = OpenBrowserWindow({ - private: isCustomHome && isTrustedHome ? "private" : "no-home", + private: true, + skipCustomHome: !(isCustomHome && isTrustedHome), }); // This mechanism to know when the new window is ready is used by // OpenBrowserWindow itself (see its definition in browser.js). @@ -435,7 +436,7 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { } const callback = () => { Services.prefs.setStringPref(trustedHomePref, homeURL); - win.BrowserHome(); + win.BrowserCommands.home(); }; const notificationBox = win.gBrowser.getNotificationBox(); notificationBox.appendNotification( ===================================== browser/modules/BrowserWindowTracker.sys.mjs ===================================== @@ -296,6 +296,7 @@ export const BrowserWindowTracker = { args = null, remote = undefined, fission = undefined, + skipCustomHome = false, } = {}) { let windowFeatures = "chrome,dialog=no,all"; if (features) { @@ -306,7 +307,7 @@ export const BrowserWindowTracker = { windowFeatures += ",private"; if ( (!args && !lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) || - args?.private === "no-home" + skipCustomHome ) { // Force the new window to load about:privatebrowsing instead of the // default home page. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/1fb85f3… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/1fb85f3… 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.10.0esr-15.0-1] 2 commits: Bug 2009213 - Use local statics for harfbuzz callback pointers, to ensure...
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch mullvad-browser-140.10.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 9a7a95dc by Jonathan Kew at 2026-04-16T09:17:32+02:00 Bug 2009213 - Use local statics for harfbuzz callback pointers, to ensure thread-safe initialization. r=gfx-reviewers,lsalzman Differential Revision: https://phabricator.services.mozilla.com/D278945 - - - - - f3289251 by Pier Angelo Vendrame at 2026-04-16T09:17:33+02:00 Bug 1666613 - Do not rely on intl.css for text direction in parsererror. r=dom-core,hsivonen,firefox-style-system-reviewers,emilio Differential Revision: https://phabricator.services.mozilla.com/D244629 - - - - - 7 changed files: - dom/xml/nsXMLContentSink.cpp - + dom/xml/test/file_bug1666613.xml - dom/xml/test/mochitest.toml - + dom/xml/test/test_bug1666613.html - gfx/thebes/gfxHarfBuzzShaper.cpp - gfx/thebes/gfxHarfBuzzShaper.h - layout/style/res/ua.css Changes: ===================================== dom/xml/nsXMLContentSink.cpp ===================================== @@ -54,6 +54,7 @@ #include "mozilla/dom/ScriptLoader.h" #include "mozilla/dom/txMozillaXSLTProcessor.h" #include "mozilla/dom/nsCSPUtils.h" +#include "mozilla/intl/LocaleService.h" #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/LoadInfo.h" #include "mozilla/UseCounter.h" @@ -1370,12 +1371,6 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, } // prepare to set <parsererror> as the document root - rv = HandleProcessingInstruction( - u"xml-stylesheet", - u"href=\"chrome://global/locale/intl.css\" type=\"text/css\""); - NS_ENSURE_SUCCESS(rv, rv); - - const char16_t* noAtts[] = {0, 0}; constexpr auto errorNs = u"http://www.mozilla.org/newlayout/xml/parsererror.xml"_ns; @@ -1384,7 +1379,12 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, parsererror.Append((char16_t)0xFFFF); parsererror.AppendLiteral("parsererror"); - rv = HandleStartElement(parsererror.get(), noAtts, 0, (uint32_t)-1, 0); + const char16_t* dirAttr[] = {u"dir", u"ltr", 0, 0}; + if (intl::LocaleService::GetInstance()->IsAppLocaleRTL() && + !mDocument->ShouldResistFingerprinting(RFPTarget::JSLocale)) { + dirAttr[1] = u"rtl"; + } + rv = HandleStartElement(parsererror.get(), dirAttr, 0, 2, 0); NS_ENSURE_SUCCESS(rv, rv); rv = HandleCharacterData(aErrorText, NS_strlen(aErrorText), false); @@ -1394,6 +1394,7 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, sourcetext.Append((char16_t)0xFFFF); sourcetext.AppendLiteral("sourcetext"); + const char16_t* noAtts[] = {0, 0}; rv = HandleStartElement(sourcetext.get(), noAtts, 0, (uint32_t)-1, 0); NS_ENSURE_SUCCESS(rv, rv); ===================================== dom/xml/test/file_bug1666613.xml ===================================== @@ -0,0 +1 @@ +<invalid ===================================== dom/xml/test/mochitest.toml ===================================== @@ -4,6 +4,7 @@ support-files = [ "file_bug293347xslt.xml", "file_bug343870.xml", "file_bug691215.xml", + "file_bug1666613.xml", ] ["test_bug232004.xhtml"] @@ -19,3 +20,5 @@ skip-if = [ "http2", "http3", ] + +["test_bug1666613.html"] ===================================== dom/xml/test/test_bug1666613.html ===================================== @@ -0,0 +1,45 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for Bug 1666613</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <style>iframe { width: 90%; }</style> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1666613">Mozilla Bug 691215</a> +<p id="display"></p> +<script class="testbody" type="text/javascript"> + +SimpleTest.waitForExplicitFinish(); + +function checkDir(expected) { + return new Promise(resolve => { + let iframe = document.createElement("iframe"); + document.body.append(iframe); + iframe.onload = () => { + let parserError = iframe.contentDocument.documentElement; + is(parserError.getAttribute("dir"), expected); + resolve(); + }; + iframe.src = "file_bug1666613.xml"; + }); +} + +async function sanityTest() { + await checkDir("ltr"); + await pseudoBidiTest(); +} + +async function pseudoBidiTest() { + await SpecialPowers.pushPrefEnv({ + set: [["intl.l10n.pseudo", "bidi"]] + }); + await checkDir("rtl"); + SimpleTest.finish(); +} + +sanityTest(); +</script> +</body> +</html> ===================================== gfx/thebes/gfxHarfBuzzShaper.cpp ===================================== @@ -1181,9 +1181,6 @@ static void AddOpenTypeFeature(uint32_t aTag, uint32_t aValue, void* aUserArg) { * gfxFontShaper override to initialize the text run using HarfBuzz */ -static hb_font_funcs_t* sHBFontFuncs = nullptr; -static hb_font_funcs_t* sNominalGlyphFunc = nullptr; -static hb_unicode_funcs_t* sHBUnicodeFuncs = nullptr; MOZ_RUNINIT static const hb_script_t sMathScript = hb_ot_tag_to_script(HB_TAG('m', 'a', 't', 'h')); @@ -1192,52 +1189,58 @@ bool gfxHarfBuzzShaper::Initialize() { // other thread can yet be using it. MOZ_PUSH_IGNORE_THREAD_SAFETY - if (!sHBFontFuncs) { - // static function callback pointers, initialized by the first - // harfbuzz shaper used - sHBFontFuncs = hb_font_funcs_create(); - hb_font_funcs_set_nominal_glyph_func(sHBFontFuncs, HBGetNominalGlyph, - nullptr, nullptr); - hb_font_funcs_set_nominal_glyphs_func(sHBFontFuncs, HBGetNominalGlyphs, - nullptr, nullptr); - hb_font_funcs_set_variation_glyph_func(sHBFontFuncs, HBGetVariationGlyph, - nullptr, nullptr); - hb_font_funcs_set_glyph_h_advance_func(sHBFontFuncs, HBGetGlyphHAdvance, - nullptr, nullptr); - hb_font_funcs_set_glyph_h_advances_func(sHBFontFuncs, HBGetGlyphHAdvances, - nullptr, nullptr); - hb_font_funcs_set_glyph_v_advance_func(sHBFontFuncs, HBGetGlyphVAdvance, - nullptr, nullptr); - hb_font_funcs_set_glyph_v_origin_func(sHBFontFuncs, HBGetGlyphVOrigin, - nullptr, nullptr); - hb_font_funcs_set_glyph_extents_func(sHBFontFuncs, HBGetGlyphExtents, - nullptr, nullptr); - hb_font_funcs_set_glyph_contour_point_func(sHBFontFuncs, HBGetContourPoint, + // Function callback pointers; these are local statics to ensure thread-safe + // initialization on first use. + static hb_font_funcs_t* sHBFontFuncs = [] { + auto* funcs = hb_font_funcs_create(); + hb_font_funcs_set_nominal_glyph_func(funcs, HBGetNominalGlyph, nullptr, + nullptr); + hb_font_funcs_set_nominal_glyphs_func(funcs, HBGetNominalGlyphs, nullptr, + nullptr); + hb_font_funcs_set_variation_glyph_func(funcs, HBGetVariationGlyph, nullptr, + nullptr); + hb_font_funcs_set_glyph_h_advance_func(funcs, HBGetGlyphHAdvance, nullptr, + nullptr); + hb_font_funcs_set_glyph_h_advances_func(funcs, HBGetGlyphHAdvances, nullptr, + nullptr); + hb_font_funcs_set_glyph_v_advance_func(funcs, HBGetGlyphVAdvance, nullptr, + nullptr); + hb_font_funcs_set_glyph_v_origin_func(funcs, HBGetGlyphVOrigin, nullptr, + nullptr); + hb_font_funcs_set_glyph_extents_func(funcs, HBGetGlyphExtents, nullptr, + nullptr); + hb_font_funcs_set_glyph_contour_point_func(funcs, HBGetContourPoint, nullptr, nullptr); - hb_font_funcs_set_glyph_h_kerning_func(sHBFontFuncs, HBGetHKerning, nullptr, + hb_font_funcs_set_glyph_h_kerning_func(funcs, HBGetHKerning, nullptr, nullptr); - hb_font_funcs_make_immutable(sHBFontFuncs); - - sNominalGlyphFunc = hb_font_funcs_create(); - hb_font_funcs_set_nominal_glyph_func(sNominalGlyphFunc, HBGetNominalGlyph, - nullptr, nullptr); - hb_font_funcs_make_immutable(sNominalGlyphFunc); - - sHBUnicodeFuncs = hb_unicode_funcs_create(hb_unicode_funcs_get_empty()); - hb_unicode_funcs_set_mirroring_func(sHBUnicodeFuncs, HBGetMirroring, - nullptr, nullptr); - hb_unicode_funcs_set_script_func(sHBUnicodeFuncs, HBGetScript, nullptr, - nullptr); - hb_unicode_funcs_set_general_category_func( - sHBUnicodeFuncs, HBGetGeneralCategory, nullptr, nullptr); - hb_unicode_funcs_set_combining_class_func( - sHBUnicodeFuncs, HBGetCombiningClass, nullptr, nullptr); - hb_unicode_funcs_set_compose_func(sHBUnicodeFuncs, HBUnicodeCompose, - nullptr, nullptr); - hb_unicode_funcs_set_decompose_func(sHBUnicodeFuncs, HBUnicodeDecompose, - nullptr, nullptr); - hb_unicode_funcs_make_immutable(sHBUnicodeFuncs); - } + hb_font_funcs_make_immutable(funcs); + return funcs; + }(); + + static hb_font_funcs_t* sNominalGlyphFunc = [] { + auto* funcs = hb_font_funcs_create(); + hb_font_funcs_set_nominal_glyph_func(funcs, HBGetNominalGlyph, nullptr, + nullptr); + hb_font_funcs_make_immutable(funcs); + return funcs; + }(); + + static hb_unicode_funcs_t* sHBUnicodeFuncs = [] { + auto* funcs = hb_unicode_funcs_create(hb_unicode_funcs_get_empty()); + hb_unicode_funcs_set_mirroring_func(funcs, HBGetMirroring, nullptr, + nullptr); + hb_unicode_funcs_set_script_func(funcs, HBGetScript, nullptr, nullptr); + hb_unicode_funcs_set_general_category_func(funcs, HBGetGeneralCategory, + nullptr, nullptr); + hb_unicode_funcs_set_combining_class_func(funcs, HBGetCombiningClass, + nullptr, nullptr); + hb_unicode_funcs_set_compose_func(funcs, HBUnicodeCompose, nullptr, + nullptr); + hb_unicode_funcs_set_decompose_func(funcs, HBUnicodeDecompose, nullptr, + nullptr); + hb_unicode_funcs_make_immutable(funcs); + return funcs; + }(); gfxFontEntry* entry = mFont->GetFontEntry(); if (!mUseFontGetGlyph) { @@ -1280,11 +1283,10 @@ bool gfxHarfBuzzShaper::Initialize() { hb_buffer_set_cluster_level(mBuffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS); - auto* funcs = - mFont->GetFontEntry()->HasFontTable(TRUETYPE_TAG('C', 'F', 'F', ' ')) - ? sNominalGlyphFunc - : sHBFontFuncs; - mHBFont = CreateHBFont(mFont, funcs, this); + bool isCFF = + mFont->GetFontEntry()->HasFontTable(TRUETYPE_TAG('C', 'F', 'F', ' ')); + auto* funcs = isCFF ? sNominalGlyphFunc : sHBFontFuncs; + mHBFont = CreateHBFont(mFont, funcs, this, isCFF); MOZ_POP_THREAD_SAFETY @@ -1293,12 +1295,13 @@ bool gfxHarfBuzzShaper::Initialize() { hb_font_t* gfxHarfBuzzShaper::CreateHBFont(gfxFont* aFont, hb_font_funcs_t* aFontFuncs, - void* aCallbackData) { + void* aCallbackData, + bool aCreateSubfont) { auto face(aFont->GetFontEntry()->GetHBFace()); hb_font_t* result = hb_font_create(face); if (aFontFuncs && aCallbackData) { - if (aFontFuncs == sNominalGlyphFunc) { + if (aCreateSubfont) { hb_font_t* subfont = hb_font_create_sub_font(result); hb_font_destroy(result); result = subfont; ===================================== gfx/thebes/gfxHarfBuzzShaper.h ===================================== @@ -103,7 +103,8 @@ class gfxHarfBuzzShaper : public gfxFontShaper { // bounds, etc; if not, the built-in hb_ot font functions will be used. static hb_font_t* CreateHBFont(gfxFont* aFont, hb_font_funcs_t* aFontFuncs = nullptr, - void* aCallbackData = nullptr); + void* aCallbackData = nullptr, + bool aCreateSubfont = false); protected: // Initializes the shaper and returns whether this was successful. ===================================== layout/style/res/ua.css ===================================== @@ -434,6 +434,10 @@ parsererror|parsererror { color: black; } +parsererror|parsererror[dir="rtl"] { + direction: rtl; +} + parsererror|sourcetext { display: block; white-space: pre; @@ -443,6 +447,7 @@ parsererror|sourcetext { color: red; font-weight: bold; font-size: 12pt; + direction: ltr; } /* Custom content container in the CanvasFrame, positioned on top of everything View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/05… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/05… 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.10.0esr-15.0-1] Bug 1666613 - Do not rely on intl.css for text direction in parsererror....
by Pier Angelo Vendrame (@pierov) 16 Apr '26

16 Apr '26
Pier Angelo Vendrame pushed to branch tor-browser-140.10.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 2e24cfd0 by Pier Angelo Vendrame at 2026-04-16T09:04:35+02:00 Bug 1666613 - Do not rely on intl.css for text direction in parsererror. r=dom-core,hsivonen,firefox-style-system-reviewers,emilio Differential Revision: https://phabricator.services.mozilla.com/D244629 - - - - - 5 changed files: - dom/xml/nsXMLContentSink.cpp - + dom/xml/test/file_bug1666613.xml - dom/xml/test/mochitest.toml - + dom/xml/test/test_bug1666613.html - layout/style/res/ua.css Changes: ===================================== dom/xml/nsXMLContentSink.cpp ===================================== @@ -54,6 +54,7 @@ #include "mozilla/dom/ScriptLoader.h" #include "mozilla/dom/txMozillaXSLTProcessor.h" #include "mozilla/dom/nsCSPUtils.h" +#include "mozilla/intl/LocaleService.h" #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/LoadInfo.h" #include "mozilla/UseCounter.h" @@ -1370,12 +1371,6 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, } // prepare to set <parsererror> as the document root - rv = HandleProcessingInstruction( - u"xml-stylesheet", - u"href=\"chrome://global/locale/intl.css\" type=\"text/css\""); - NS_ENSURE_SUCCESS(rv, rv); - - const char16_t* noAtts[] = {0, 0}; constexpr auto errorNs = u"http://www.mozilla.org/newlayout/xml/parsererror.xml"_ns; @@ -1384,7 +1379,12 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, parsererror.Append((char16_t)0xFFFF); parsererror.AppendLiteral("parsererror"); - rv = HandleStartElement(parsererror.get(), noAtts, 0, (uint32_t)-1, 0); + const char16_t* dirAttr[] = {u"dir", u"ltr", 0, 0}; + if (intl::LocaleService::GetInstance()->IsAppLocaleRTL() && + !mDocument->ShouldResistFingerprinting(RFPTarget::JSLocale)) { + dirAttr[1] = u"rtl"; + } + rv = HandleStartElement(parsererror.get(), dirAttr, 0, 2, 0); NS_ENSURE_SUCCESS(rv, rv); rv = HandleCharacterData(aErrorText, NS_strlen(aErrorText), false); @@ -1394,6 +1394,7 @@ nsXMLContentSink::ReportError(const char16_t* aErrorText, sourcetext.Append((char16_t)0xFFFF); sourcetext.AppendLiteral("sourcetext"); + const char16_t* noAtts[] = {0, 0}; rv = HandleStartElement(sourcetext.get(), noAtts, 0, (uint32_t)-1, 0); NS_ENSURE_SUCCESS(rv, rv); ===================================== dom/xml/test/file_bug1666613.xml ===================================== @@ -0,0 +1 @@ +<invalid ===================================== dom/xml/test/mochitest.toml ===================================== @@ -4,6 +4,7 @@ support-files = [ "file_bug293347xslt.xml", "file_bug343870.xml", "file_bug691215.xml", + "file_bug1666613.xml", ] ["test_bug232004.xhtml"] @@ -19,3 +20,5 @@ skip-if = [ "http2", "http3", ] + +["test_bug1666613.html"] ===================================== dom/xml/test/test_bug1666613.html ===================================== @@ -0,0 +1,45 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for Bug 1666613</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <style>iframe { width: 90%; }</style> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1666613">Mozilla Bug 691215</a> +<p id="display"></p> +<script class="testbody" type="text/javascript"> + +SimpleTest.waitForExplicitFinish(); + +function checkDir(expected) { + return new Promise(resolve => { + let iframe = document.createElement("iframe"); + document.body.append(iframe); + iframe.onload = () => { + let parserError = iframe.contentDocument.documentElement; + is(parserError.getAttribute("dir"), expected); + resolve(); + }; + iframe.src = "file_bug1666613.xml"; + }); +} + +async function sanityTest() { + await checkDir("ltr"); + await pseudoBidiTest(); +} + +async function pseudoBidiTest() { + await SpecialPowers.pushPrefEnv({ + set: [["intl.l10n.pseudo", "bidi"]] + }); + await checkDir("rtl"); + SimpleTest.finish(); +} + +sanityTest(); +</script> +</body> +</html> ===================================== layout/style/res/ua.css ===================================== @@ -434,6 +434,10 @@ parsererror|parsererror { color: black; } +parsererror|parsererror[dir="rtl"] { + direction: rtl; +} + parsererror|sourcetext { display: block; white-space: pre; @@ -443,6 +447,7 @@ parsererror|sourcetext { color: red; font-weight: bold; font-size: 12pt; + direction: ltr; } /* Custom content container in the CanvasFrame, positioned on top of everything View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2e24cfd… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2e24cfd… 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
  • ...
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • ...
  • 2043
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.