1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 18:55:07 +00:00

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
73 changed files with 249 additions and 433 deletions

View file

@ -127,7 +127,7 @@ GUI::Variant LayoutTreeModel::data(const GUI::ModelIndex& index, Role role) cons
}
if (role == Role::Display) {
if (node.is_text())
return String::format("LayoutText: %s", with_whitespace_collapsed(to<LayoutText>(node).text_for_rendering()).characters());
return String::format("LayoutText: %s", with_whitespace_collapsed(downcast<LayoutText>(node).text_for_rendering()).characters());
StringBuilder builder;
builder.append(node.class_name());
builder.append(' ');
@ -136,7 +136,7 @@ GUI::Variant LayoutTreeModel::data(const GUI::ModelIndex& index, Role role) cons
} else if (!node.node()->is_element()) {
builder.append(node.node()->node_name());
} else {
auto& element = to<Element>(*node.node());
auto& element = downcast<Element>(*node.node());
builder.append('<');
builder.append(element.local_name());
element.for_each_attribute([&](auto& name, auto& value) {