From 590b41a7b80b3874e45bef25836b89244afe095a Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 23 Aug 2023 21:35:01 +0000 Subject: [PATCH] Bug 1849791: Enable context paint in SVG of moz-anno protocol r=places-reviewers,dholbert,mak Differential Revision: https://phabricator.services.mozilla.com/D186644 --- layout/svg/SVGContextPaint.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/layout/svg/SVGContextPaint.cpp b/layout/svg/SVGContextPaint.cpp index 181b637400c7..41d2c8af83e7 100644 --- a/layout/svg/SVGContextPaint.cpp +++ b/layout/svg/SVGContextPaint.cpp @@ -45,9 +45,14 @@ bool SVGContextPaint::IsAllowedForImageFromURI(nsIURI* aURI) { // good mechanism for wider use, or suitable for specification.) // // Because the default favicon used in the browser UI needs context paint, we - // also allow it for page-icon:. This exposes context paint to - // 3rd-party favicons, but only for history and bookmark items. Other places - // such as the tab bar don't use the page-icon protocol to load favicons. + // also allow it for: + // - page-icon: (used in history and bookmark items) + // - moz-anno:favicon: (used in the awesomebar) + // This allowance does also inadvertently expose context-paint to 3rd-party + // favicons, which is not great, but that hasn't caused trouble as far as we + // know. Also: other places such as the tab bar don't use these protocols to + // load favicons, so they help to ensure that 3rd-party favicons don't grow + // to depend on this feature. // // One case that is not covered by chrome:// or resource:// are WebExtensions, // specifically ones that are "ours". WebExtensions are moz-extension:// @@ -63,7 +68,7 @@ bool SVGContextPaint::IsAllowedForImageFromURI(nsIURI* aURI) { nsAutoCString scheme; if (NS_SUCCEEDED(aURI->GetScheme(scheme)) && (scheme.EqualsLiteral("chrome") || scheme.EqualsLiteral("resource") || - scheme.EqualsLiteral("page-icon"))) { + scheme.EqualsLiteral("page-icon") || scheme.EqualsLiteral("moz-anno"))) { return true; } RefPtr principal = -- 2.11.4.GIT