1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +00:00

LibWebView: Replace uses of JsonObject::get_deprecated()/get_ptr()

This commit is contained in:
Sam Atkins 2022-12-21 17:28:30 +00:00 committed by Tim Flynn
parent d8fde14324
commit 3cc376d1a2
4 changed files with 32 additions and 39 deletions

View file

@ -49,11 +49,9 @@ private:
return *parent_node;
}
ALWAYS_INLINE static JsonArray const* get_children(JsonObject const& o)
ALWAYS_INLINE static Optional<JsonArray const&> const get_children(JsonObject const& o)
{
if (auto const* maybe_children = o.get_ptr("children"sv); maybe_children)
return &maybe_children->as_array();
return nullptr;
return o.get_array("children"sv);
}
void map_dom_nodes_to_parent(JsonObject const* parent, JsonObject const* child);