Bug 671389 - Implement CSP sandbox directive. r=ckerschb r=smaug

This commit is contained in:
Paul Roberts
2016-06-29 07:48:44 -07:00
parent 89deea28e2
commit 2108c2d0b5
14 changed files with 281 additions and 22 deletions

View File

@@ -242,17 +242,10 @@ HTMLIFrameElement::GetSandboxFlags()
const nsAttrValue* sandboxAttr = GetParsedAttr(nsGkAtoms::sandbox);
// No sandbox attribute, no sandbox flags.
if (!sandboxAttr) {
return 0;
return SANDBOXED_NONE;
}
// Start off by setting all the restriction flags.
uint32_t out = SANDBOX_ALL_FLAGS;
// Macro for updating the flag according to the keywords
#define SANDBOX_KEYWORD(string, atom, flags) \
if (sandboxAttr->Contains(nsGkAtoms::atom, eIgnoreCase)) { out &= ~(flags); }
#include "IframeSandboxKeywordList.h"
#undef SANDBOX_KEYWORD
uint32_t out = nsContentUtils::ParseSandboxAttributeToFlags(sandboxAttr);
if (GetParsedAttr(nsGkAtoms::allowfullscreen) ||
GetParsedAttr(nsGkAtoms::mozallowfullscreen)) {