mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb/CSP: Implement the style-src directive
This commit is contained in:
parent
d1abd11b78
commit
8b0b3b186f
Notes:
github-actions[bot]
2025-07-17 23:59:22 +00:00
Author: https://github.com/Lubrsi
Commit: 8b0b3b186f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5490
Reviewed-by: https://github.com/shannonbooth ✅
6 changed files with 130 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/BlockingAlgorithms.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
#include <LibWeb/DOM/StyleElementUtils.h>
|
||||
|
@ -50,7 +51,9 @@ void StyleElementUtils::update_a_style_block(DOM::Element& style_element)
|
|||
if (type_attribute.has_value() && !type_attribute->is_empty() && !type_attribute->bytes_as_string_view().equals_ignoring_ascii_case("text/css"sv))
|
||||
return;
|
||||
|
||||
// FIXME: 5. If the Should element's inline behavior be blocked by Content Security Policy? algorithm returns "Blocked" when executed upon the style element, "style", and the style element's child text content, then return. [CSP]
|
||||
// 5. If the Should element's inline behavior be blocked by Content Security Policy? algorithm returns "Blocked" when executed upon the style element, "style", and the style element's child text content, then return. [CSP]
|
||||
if (ContentSecurityPolicy::should_elements_inline_type_behavior_be_blocked_by_content_security_policy(style_element.realm(), style_element, ContentSecurityPolicy::Directives::Directive::InlineType::Style, style_element.child_text_content()) == ContentSecurityPolicy::Directives::Directive::Result::Blocked)
|
||||
return;
|
||||
|
||||
// 6. Create a CSS style sheet with the following properties:
|
||||
// type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue