mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 23:07:33 +09:00
Issue #2466 - Part 3: Implement style-src-elem and style-src-attr
This commit is contained in:
parent
ff01a35bdb
commit
721ded9b48
8 changed files with 78 additions and 12 deletions
|
|
@ -143,7 +143,9 @@ static const char* CSPStrDirectives[] = {
|
|||
"sandbox", // SANDBOX_DIRECTIVE
|
||||
"worker-src", // WORKER_SRC_DIRECTIVE
|
||||
"script-src-elem", // SCRIPT_SRC_ELEM_DIRECTIVE
|
||||
"script-src-attr" // SCRIPT_SRC_ATTR_DIRECTIVE
|
||||
"script-src-attr", // SCRIPT_SRC_ATTR_DIRECTIVE
|
||||
"style-src-elem", // STYLE_SRC_ELEM_DIRECTIVE
|
||||
"style-src-attr" // STYLE_SRC_ATTR_DIRECTIVE
|
||||
};
|
||||
|
||||
inline const char* CSP_CSPDirectiveToString(CSPDirective aDir)
|
||||
|
|
@ -551,6 +553,27 @@ class nsCSPScriptSrcDirective : public nsCSPDirective {
|
|||
bool mRestrictScriptAttr;
|
||||
};
|
||||
|
||||
/* =============== nsCSPStyleSrcDirective ============= */
|
||||
|
||||
/*
|
||||
* In CSP 3, style-src is used as a fallback for style-src-elem and
|
||||
* style-src-attr in case they aren't defined.
|
||||
*/
|
||||
class nsCSPStyleSrcDirective : public nsCSPDirective {
|
||||
public:
|
||||
explicit nsCSPStyleSrcDirective(CSPDirective aDirective);
|
||||
virtual ~nsCSPStyleSrcDirective();
|
||||
|
||||
void setRestrictStyleElem() { mRestrictStyleElem = true; }
|
||||
void setRestrictStyleAttr() { mRestrictStyleAttr = true; }
|
||||
|
||||
virtual bool equals(CSPDirective aDirective) const;
|
||||
|
||||
private:
|
||||
bool mRestrictStyleElem;
|
||||
bool mRestrictStyleAttr;
|
||||
};
|
||||
|
||||
/* =============== nsBlockAllMixedContentDirective === */
|
||||
|
||||
class nsBlockAllMixedContentDirective : public nsCSPDirective {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue