1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:35:06 +00:00

LibWeb: Make Element::tag_name() return a const FlyString&

The more generic virtual variant is renamed to node_name() and now only
Element has tag_name(). This removes a huge amount of String ctor/dtor
churn in selector matching.
This commit is contained in:
Andreas Kling 2020-06-16 19:09:14 +02:00
parent ea1ebe8662
commit 6242e029ed
12 changed files with 13 additions and 12 deletions

View file

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