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

LibWeb: Use ValueID for media-query identifiers

This commit is contained in:
Sam Atkins 2022-03-08 17:57:37 +00:00 committed by Andreas Kling
parent 0371d33132
commit fd47460141
4 changed files with 26 additions and 24 deletions

View file

@ -1187,8 +1187,10 @@ Optional<MediaFeatureValue> Parser::parse_media_feature_value(TokenStream<StyleC
}
// `<ident>`
if (first.is(Token::Type::Ident) && !tokens.has_next_token())
return MediaFeatureValue(first.token().ident());
if (first.is(Token::Type::Ident)) {
if (auto ident = value_id_from_string(first.token().ident()); ident != ValueID::Invalid)
return MediaFeatureValue(ident);
}
// `<ratio>`
// Note that a single <number> is a valid <ratio>, but it gets parsed above as a <number>.