Skip to content
Snippets Groups Projects
Commit 455f4be3 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by Beatriz Rizental
Browse files

Bug 1923260 - Exempt Android resources from svg.disabled. r=peterv

parent 5a52f1a5
Branches
Tags
1 merge request!1527Bug 43808: Rebase 128.10.1 onto 128.11
......@@ -351,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!");
......@@ -376,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 ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment