morgan pushed to branch base-browser-128.7.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: f675e2ca by Pier Angelo Vendrame at 2025-02-19T14:24:57+00:00 dropme! BB 40925: Implemented the Security Level component
BB 43498: Remove our old patch for 43129.
This commit should be ignored at the next rebase (and we will likely have a conflict on the security level commit).
- - - - - 20e649a8 by Pier Angelo Vendrame at 2025-02-19T14:24:57+00:00 Bug 1923260 - Exempt Android resources from svg.disabled. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D224895 - - - - -
1 changed file:
- dom/base/nsNodeInfoManager.cpp
Changes:
===================================== dom/base/nsNodeInfoManager.cpp ===================================== @@ -344,16 +344,6 @@ void nsNodeInfoManager::RemoveNodeInfo(NodeInfo* aNodeInfo) { }
static bool IsSystemOrAddonOrAboutPrincipal(nsIPrincipal* aPrincipal) { -#ifdef ANDROID - if (aPrincipal->SchemeIs("resource")) { - nsAutoCString spec; - aPrincipal->GetAsciiSpec(spec); - if (StringBeginsWith(spec, "resource://android/assets/"_ns)) { - return true; - } - } -#endif - return aPrincipal->IsSystemPrincipal() || BasePrincipal::Cast(aPrincipal)->AddonPolicy() || // NOTE: about:blank and about:srcdoc inherit the principal of their @@ -361,6 +351,21 @@ static bool IsSystemOrAddonOrAboutPrincipal(nsIPrincipal* aPrincipal) { aPrincipal->SchemeIs("about"); }
+static bool IsAndroidResource(nsIURI* aURI) { +#ifdef ANDROID + if (aURI->SchemeIs("resource")) { + nsAutoCString host, path; + aURI->GetHost(host); + aURI->GetFilePath(path); + if (host.EqualsLiteral("android") && + StringBeginsWith(path, "/assets/"_ns)) { + return true; + } + } +#endif + return false; +} + bool nsNodeInfoManager::InternalSVGEnabled() { MOZ_ASSERT(!mSVGEnabled, "Caller should use the cached mSVGEnabled!");
@@ -386,6 +391,7 @@ bool nsNodeInfoManager::InternalSVGEnabled() { // of system or add-on UI or about: page) bool conclusion = (SVGEnabled || IsSystemOrAddonOrAboutPrincipal(mPrincipal) || + IsAndroidResource(mDocument->GetDocumentURI()) || (loadInfo && (loadInfo->GetExternalContentPolicyType() == ExtContentPolicy::TYPE_IMAGE ||
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/5236390...
tor-commits@lists.torproject.org