1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()

This is a preparatory step to making `get()` return `ErrorOr`.
This commit is contained in:
Sam Atkins 2022-12-21 11:42:06 +00:00 committed by Tim Flynn
parent efe4329f9f
commit 1dd6b7f5b7
76 changed files with 671 additions and 671 deletions

View file

@ -119,8 +119,8 @@ static DeprecatedString with_whitespace_collapsed(StringView string)
GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
auto const& node = *static_cast<JsonObject const*>(index.internal_data());
auto node_name = node.get("name"sv).as_string();
auto type = node.get("type"sv).as_string_or("unknown"sv);
auto node_name = node.get_deprecated("name"sv).as_string();
auto type = node.get_deprecated("type"sv).as_string_or("unknown"sv);
// FIXME: This FIXME can go away when we fix the one below.
#ifdef AK_OS_SERENITY
@ -131,7 +131,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
return m_tree_view->palette().syntax_comment();
if (type == "pseudo-element"sv)
return m_tree_view->palette().syntax_type();
if (!node.get("visible"sv).to_bool(true))
if (!node.get_deprecated("visible"sv).to_bool(true))
return m_tree_view->palette().syntax_comment();
return {};
}
@ -151,9 +151,9 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
if (role == GUI::ModelRole::Display) {
if (type == "text")
return with_whitespace_collapsed(node.get("text"sv).as_string());
return with_whitespace_collapsed(node.get_deprecated("text"sv).as_string());
if (type == "comment"sv)
return DeprecatedString::formatted("<!--{}-->", node.get("data"sv).as_string());
return DeprecatedString::formatted("<!--{}-->", node.get_deprecated("data"sv).as_string());
if (type != "element")
return node_name;
@ -161,7 +161,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
builder.append('<');
builder.append(node_name.to_lowercase());
if (node.has("attributes"sv)) {
auto attributes = node.get("attributes"sv).as_object();
auto attributes = node.get_deprecated("attributes"sv).as_object();
attributes.for_each_member([&builder](auto& name, JsonValue const& value) {
builder.append(' ');
builder.append(name);
@ -180,7 +180,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
void DOMTreeModel::map_dom_nodes_to_parent(JsonObject const* parent, JsonObject const* node)
{
m_dom_node_to_parent_map.set(node, parent);
m_node_id_to_dom_node_map.set(node->get("id"sv).to_i32(), node);
m_node_id_to_dom_node_map.set(node->get_deprecated("id"sv).to_i32(), node);
auto const* children = get_children(*node);
if (!children)
@ -204,7 +204,7 @@ GUI::ModelIndex DOMTreeModel::index_for_node(i32 node_id, Optional<Web::CSS::Sel
if (!child.has("pseudo-element"sv))
continue;
auto child_pseudo_element = child.get("pseudo-element"sv);
auto child_pseudo_element = child.get_deprecated("pseudo-element"sv);
if (!child_pseudo_element.is_i32())
continue;