mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Lazy evaluate optional to avoid crash
This commit is contained in:
parent
5cdeb994b2
commit
e23d31ae83
Notes:
sideshowbarker
2024-07-16 23:55:09 +09:00
Author: https://github.com/stelar7 Commit: https://github.com/SerenityOS/serenity/commit/e23d31ae83 Pull-request: https://github.com/SerenityOS/serenity/pull/19167
@ -7492,8 +7492,10 @@ ErrorOr<Parser::PropertyAndValue> Parser::parse_css_value_for_properties(Readonl
|
||||
break;
|
||||
case CalculatedStyleValue::ResolvedType::Integer:
|
||||
case CalculatedStyleValue::ResolvedType::Number:
|
||||
if (property_accepts_numeric)
|
||||
return PropertyAndValue { property_accepting_integer.value_or(property_accepting_number.value()), calculated };
|
||||
if (property_accepts_numeric) {
|
||||
auto property_or_resolved = property_accepting_integer.value_or_lazy_evaluated([property_accepting_number]() { return property_accepting_number.value(); });
|
||||
return PropertyAndValue { property_or_resolved, calculated };
|
||||
}
|
||||
break;
|
||||
case CalculatedStyleValue::ResolvedType::Length:
|
||||
if (auto property = any_property_accepts_type(property_ids, ValueType::Length); property.has_value())
|
||||
|
Loading…
Reference in New Issue
Block a user