LibWeb: Switch to using AK::is and AK::downcast

This commit is contained in:
Andreas Kling 2020-07-26 17:16:18 +02:00
parent fe6474e692
commit 71556e39a4
Notes: sideshowbarker 2024-07-19 04:36:12 +09:00
73 changed files with 249 additions and 433 deletions

View file

@ -128,10 +128,10 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, Role role) const
}
if (role == Role::Display) {
if (node.is_text())
return String::format("%s", with_whitespace_collapsed(to<Text>(node).data()).characters());
return String::format("%s", with_whitespace_collapsed(downcast<Text>(node).data()).characters());
if (!node.is_element())
return node.node_name();
auto& element = to<Element>(node);
auto& element = downcast<Element>(node);
StringBuilder builder;
builder.append('<');
builder.append(element.local_name());