LibWeb/CSP: Implement the style-src-elem directive

This commit is contained in:
Luke Wilde 2024-12-03 17:16:27 +00:00 committed by Shannon Booth
commit 574b736156
Notes: github-actions[bot] 2025-07-17 23:59:17 +00:00
5 changed files with 126 additions and 0 deletions

View file

@ -19,6 +19,7 @@
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/ScriptSourceElementDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/StyleSourceDirective.h>
#include <LibWeb/ContentSecurityPolicy/Directives/StyleSourceElementDirective.h>
namespace Web::ContentSecurityPolicy::Directives {
@ -57,6 +58,9 @@ GC::Ref<Directive> create_directive(GC::Heap& heap, String name, Vector<String>
if (name == Names::StyleSrc)
return heap.allocate<StyleSourceDirective>(move(name), move(value));
if (name == Names::StyleSrcElem)
return heap.allocate<StyleSourceElementDirective>(move(name), move(value));
return heap.allocate<Directive>(move(name), move(value));
}