LibWeb: Use FlyString for Element tag names

This makes selector matching a lot more efficient, and also reduces the
number of strings on the heap.
This commit is contained in:
Andreas Kling 2020-03-22 19:10:43 +01:00
commit 7309642ca8
Notes: sideshowbarker 2024-07-19 08:10:55 +09:00
48 changed files with 67 additions and 63 deletions

View file

@ -32,14 +32,14 @@ namespace Web {
class HTMLHeadElement : public HTMLElement {
public:
HTMLHeadElement(Document&, const String& tag_name);
HTMLHeadElement(Document&, const FlyString& tag_name);
virtual ~HTMLHeadElement() override;
};
template<>
inline bool is<HTMLHeadElement>(const Node& node)
{
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "head";
return is<Element>(node) && to<Element>(node).tag_name().equals_ignoring_case("head");
}
}