1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibWeb: Move check for CSS-wide keywords to ValueID.h

This feels like a better home for it. The new name better reflects the
spec phrasing.
This commit is contained in:
Sam Atkins 2023-09-04 14:39:10 +01:00 committed by Andreas Kling
parent bf8aa33b68
commit e9b58ff096
3 changed files with 10 additions and 10 deletions

View file

@ -1488,7 +1488,7 @@ CSSRule* Parser::convert_to_rule(NonnullRefPtr<Rule> rule)
return {};
}
if (name_token.is(Token::Type::Ident) && (is_builtin(name_token.ident()) || name_token.ident().equals_ignoring_ascii_case("none"sv))) {
if (name_token.is(Token::Type::Ident) && (is_css_wide_keyword(name_token.ident()) || name_token.ident().equals_ignoring_ascii_case("none"sv))) {
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @keyframes rule name is invalid: {}; discarding.", name_token.ident());
return {};
}
@ -4246,7 +4246,7 @@ CSSRule* Parser::parse_font_face_rule(TokenStream<ComponentValue>& tokens)
continue;
}
if (part.is(Token::Type::Ident)) {
if (is_builtin(part.token().ident())) {
if (is_css_wide_keyword(part.token().ident())) {
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @font-face font-family format invalid; discarding.");
had_syntax_error = true;
break;
@ -6483,13 +6483,6 @@ bool Parser::has_ignored_vendor_prefix(StringView string)
return true;
}
bool Parser::is_builtin(StringView name)
{
return name.equals_ignoring_ascii_case("inherit"sv)
|| name.equals_ignoring_ascii_case("initial"sv)
|| name.equals_ignoring_ascii_case("unset"sv);
}
RefPtr<CalculatedStyleValue> Parser::parse_calculated_value(Badge<StyleComputer>, ParsingContext const& context, ComponentValue const& token)
{
auto parser = MUST(Parser::create(context, ""sv));