1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

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
parent c4a6d6ae9f
commit 7309642ca8
48 changed files with 67 additions and 63 deletions

View file

@ -32,7 +32,7 @@ namespace Web {
class HTMLBRElement final : public HTMLElement {
public:
HTMLBRElement(Document&, const String& tag_name);
HTMLBRElement(Document&, const FlyString& tag_name);
virtual ~HTMLBRElement() override;
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
@ -41,7 +41,7 @@ public:
template<>
inline bool is<HTMLBRElement>(const Node& node)
{
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "br";
return is<Element>(node) && to<Element>(node).tag_name().equals_ignoring_case("br");
}
}