mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +00:00
LibWeb: Use is_ascii_case_insensitive_match() where the spec says to
This commit is contained in:
parent
f0b72b819e
commit
2026ea557e
Notes:
sideshowbarker
2024-07-17 00:04:12 +09:00
Author: https://github.com/AtkinsSJ
Commit: 2026ea557e
Pull-request: https://github.com/SerenityOS/serenity/pull/17502
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/trflynn89
10 changed files with 59 additions and 44 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/HTMLStyleElement.h>
|
||||
#include <LibWeb/Infra/Strings.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -131,7 +132,7 @@ void HTMLStyleElement::update_a_style_block()
|
|||
|
||||
// 4. If element's type attribute is present and its value is neither the empty string nor an ASCII case-insensitive match for "text/css", then return.
|
||||
auto type_attribute = attribute(HTML::AttributeNames::type);
|
||||
if (!type_attribute.is_null() && !type_attribute.is_empty() && !type_attribute.equals_ignoring_case("text/css"sv))
|
||||
if (!type_attribute.is_null() && !type_attribute.is_empty() && !Infra::is_ascii_case_insensitive_match(type_attribute, "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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue