mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Switch to using AK::is and AK::downcast
This commit is contained in:
parent
fe6474e692
commit
71556e39a4
Notes:
sideshowbarker
2024-07-19 04:36:12 +09:00
Author: https://github.com/awesomekling
Commit: 71556e39a4
73 changed files with 249 additions and 433 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue