Bug 1388907 - Add @mozilla.com and @testpilot- extension identifiers for SVG context-fill icons. draft
authorJonathan Kingston <jkt@mozilla.com>
Thu, 10 Aug 2017 01:19:14 +0100
changeset 643644 c100c9faefa85cf5cb474d1ac5c7c44daa32e6a4
parent 642518 a921bfb8a2cf3db4d9edebe9b35799a3f9d035da
child 725361 a61071fae40af2f6adc4286017def8bd97c288f0
push id73164
push userjkingston@mozilla.com
push dateThu, 10 Aug 2017 00:20:21 +0000
bugs1388907
milestone57.0a1
Bug 1388907 - Add @mozilla.com and @testpilot- extension identifiers for SVG context-fill icons. MozReview-Commit-ID: 7yHdgNfsrTc
layout/svg/SVGContextPaint.cpp
--- a/layout/svg/SVGContextPaint.cpp
+++ b/layout/svg/SVGContextPaint.cpp
@@ -59,17 +59,21 @@ SVGContextPaint::IsAllowedForImageFromUR
   nsAutoCString scheme;
   if (NS_SUCCEEDED(aURI->GetScheme(scheme)) &&
       (scheme.EqualsLiteral("chrome") || scheme.EqualsLiteral("resource"))) {
     return true;
   }
   RefPtr<BasePrincipal> principal = BasePrincipal::CreateCodebasePrincipal(aURI, OriginAttributes());
   nsString addonId;
   if (NS_SUCCEEDED(principal->GetAddonId(addonId))) {
-    return StringEndsWith(addonId, NS_LITERAL_STRING("@mozilla.org"));
+    if (StringEndsWith(addonId, NS_LITERAL_STRING("@mozilla.org"))
+        || StringEndsWith(addonId, NS_LITERAL_STRING("@mozilla.com"))
+        || StringBeginsWith(addonId, NS_LITERAL_STRING("@testpilot-"))) {
+      return true;
+    }
   }
   return false;
 }
 
 /**
  * Stores in |aTargetPaint| information on how to reconstruct the current
  * fill or stroke pattern. Will also set the paint opacity to transparent if
  * the paint is set to "none".