Bug 1388907 - Add @mozilla.com and @testpilot- extension identifiers for SVG context-fill icons. r?dao draft
authorJonathan Kingston <jkt@mozilla.com>
Thu, 10 Aug 2017 01:19:14 +0100
changeset 643646 6de77f11e07cc010ac3a7f187b87026446182a58
parent 642518 a921bfb8a2cf3db4d9edebe9b35799a3f9d035da
child 725363 b9bcbaba007a5690acb2989ace7254b0e4f5bf51
push id73166
push userjkingston@mozilla.com
push dateThu, 10 Aug 2017 00:21:35 +0000
reviewersdao
bugs1388907
milestone57.0a1
Bug 1388907 - Add @mozilla.com and @testpilot- extension identifiers for SVG context-fill icons. r?dao 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".