Bug 1316256 - Always call content policy check for TYPE_CONTENT. r=bz
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Fri, 09 Dec 2016 01:31:00 +0100
changeset 326128 7ba8dff4a242a7ddaf6da214e5fbde8fb95e9b12
parent 326127 c94ca0caa6f2f07505fb9ed3889ce0de6ed6fd23
child 326129 c2576212405e8574f39b34923ef5aaf256ad074c
push id31087
push usercbook@mozilla.com
push dateFri, 16 Dec 2016 15:06:32 +0000
treeherdermozilla-central@5a536a16e337 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1316256
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316256 - Always call content policy check for TYPE_CONTENT. r=bz
dom/base/nsContentPolicyUtils.h
--- a/dom/base/nsContentPolicyUtils.h
+++ b/dom/base/nsContentPolicyUtils.h
@@ -176,17 +176,17 @@ NS_CP_ContentTypeName(uint32_t contentTy
       if (!secMan) {                                                          \
           secMan = do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);        \
       }                                                                       \
       if (secMan) {                                                           \
           bool isSystem;                                                      \
           nsresult rv = secMan->IsSystemPrincipal(originPrincipal,            \
                                                   &isSystem);                 \
           NS_ENSURE_SUCCESS(rv, rv);                                          \
-          if (isSystem) {                                                     \
+          if (isSystem && contentType != nsIContentPolicy::TYPE_DOCUMENT) {   \
               *decision = nsIContentPolicy::ACCEPT;                           \
               nsCOMPtr<nsINode> n = do_QueryInterface(context);               \
               if (!n) {                                                       \
                   nsCOMPtr<nsPIDOMWindowOuter> win = do_QueryInterface(context);\
                   n = win ? win->GetExtantDoc() : nullptr;                    \
               }                                                               \
               if (n) {                                                        \
                   nsIDocument* d = n->OwnerDoc();                             \