1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibWeb: Make property_id_from_string() return Optional

This commit is contained in:
Sam Atkins 2023-05-10 13:01:30 +01:00 committed by Andreas Kling
parent 03613dc14d
commit 465ecf37c2
5 changed files with 29 additions and 29 deletions

View file

@ -27,8 +27,8 @@ bool supports(JS::VM& vm, StringView property, StringView value)
// 1. If property is an ASCII case-insensitive match for any defined CSS property that the UA supports,
// and value successfully parses according to that propertys grammar, return true.
if (auto property_id = property_id_from_string(property); property_id != PropertyID::Invalid) {
if (parse_css_value(Parser::ParsingContext { realm }, value, property_id).release_value_but_fixme_should_propagate_errors())
if (auto property_id = property_id_from_string(property); property_id.has_value()) {
if (parse_css_value(Parser::ParsingContext { realm }, value, property_id.value()).release_value_but_fixme_should_propagate_errors())
return true;
}