Bug 1195123: Restructure logic (pulling out "!") for SVG image rejection, to make it clearer that it matches the comment. r=longsonr

This commit is contained in:
Daniel Holbert 2015-08-16 13:37:56 -07:00
parent 1fefafdced
commit f6d74823b0

View File

@ -83,12 +83,12 @@ nsDataDocumentContentPolicy::ShouldLoad(uint32_t aContentType,
// OR
// - URI loadable by subsumers, e.g. blob URIs
// Any URI that doesn't meet these requirements will be rejected below.
if (!HasFlags(aContentLocation,
nsIProtocolHandler::URI_IS_LOCAL_RESOURCE) ||
(!HasFlags(aContentLocation,
nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT) &&
!HasFlags(aContentLocation,
nsIProtocolHandler::URI_LOADABLE_BY_SUBSUMERS))) {
if (!(HasFlags(aContentLocation,
nsIProtocolHandler::URI_IS_LOCAL_RESOURCE) &&
(HasFlags(aContentLocation,
nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT) ||
HasFlags(aContentLocation,
nsIProtocolHandler::URI_LOADABLE_BY_SUBSUMERS)))) {
*aDecision = nsIContentPolicy::REJECT_TYPE;
// Report error, if we can.