1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 19:17:44 +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

@ -1132,10 +1132,10 @@ Messages::WebDriverClient::GetElementCssValueResponse WebDriverConnection::get_e
// -> current browsing contexts active documents type is not "xml"
if (!m_page_client.page().top_level_browsing_context().active_document()->is_xml_document()) {
// computed value of parameter property name from elements style declarations. property name is obtained from url variables.
auto property = Web::CSS::property_id_from_string(name);
if (auto* computed_values = element->computed_css_values())
computed_value = computed_values->property(property)->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string();
if (auto property = Web::CSS::property_id_from_string(name); property.has_value()) {
if (auto* computed_values = element->computed_css_values())
computed_value = computed_values->property(property.value())->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string();
}
}
// -> Otherwise
else {