-
-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working backwards from https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block One of the steps in the above algorithm is https://w3c.github.io/webappsec-csp/#should-block-inline In implementing Should element’s inline type behavior be blocked by Content Security Policy?, add class declarations for Directives, Policy's, and CSP Lists
- Loading branch information
1 parent
c4f7361
commit 8f3b531
Showing
5 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2024, Noah Bright <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <AK/HashTable.h> | ||
#include <AK/String.h> | ||
#include <LibWeb/HTML/Origin.h> | ||
|
||
// https://w3c.github.io/webappsec-csp/#framework-policy | ||
namespace Web::HTML { | ||
|
||
enum class PolicyDisposition { | ||
Enforce, | ||
Report | ||
}; | ||
|
||
enum class PolicySource { | ||
Head, | ||
Meta | ||
}; | ||
|
||
// https://w3c.github.io/webappsec-csp/#content-security-policy-object | ||
struct Policy { | ||
// https://w3c.github.io/webappsec-csp/#directives | ||
OrderedHashMap<String, Optional<HashTable<String>>> directive_set; | ||
PolicyDisposition disposition; | ||
PolicySource source; | ||
HTML::Origin self_origin; | ||
}; | ||
|
||
using CSPList = Vector<Policy>; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters