LibDevTools: Don't assume computed layout values are strings

Width and height are doubles, so get_string() will return nothing and
fail. We just want a JsonValue here without caring what type it is, so
let's just use get() instead.
This commit is contained in:
Sam Atkins 2025-09-26 15:16:49 +01:00 committed by Andreas Kling
parent b8fa9ac7e7
commit 11a6b6f38f

View File

@ -30,7 +30,7 @@ static void received_layout(JsonObject& response, JsonValue const& node_box_sizi
response.set(key, MUST(String::formatted("{}px", pixel_value(key))));
};
auto set_computed_value = [&](auto key) {
response.set(key, node_box_sizing.as_object().get_string(key).value_or(String {}));
response.set(key, node_box_sizing.as_object().get(key).value_or(String {}));
};
// FIXME: This response should also contain "top", "right", "bottom", and "left", but our box model metrics in