morgan pushed to branch tor-browser-128.7.0esr-14.5-1 at The Tor Project / 
Applications / Tor Browser


Commits:
7fc0ffe8 by Pier Angelo Vendrame at 2025-02-19T08:57:31+01: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).

- - - - -
7b27fd84 by Pier Angelo Vendrame at 2025-02-19T08:57:43+01: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/6fa642ea028187c568c4a2d7216bb867f20a1912...7b27fd84d1b995e2561f8aa6c0e5209f65cf83b1

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/6fa642ea028187c568c4a2d7216bb867f20a1912...7b27fd84d1b995e2561f8aa6c0e5209f65cf83b1
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to