mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02: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:
Notes:
sideshowbarker
2024-07-19 08:10:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7309642ca88
@@ -32,7 +32,7 @@ namespace Web {
|
||||
|
||||
class HTMLInputElement : public HTMLElement {
|
||||
public:
|
||||
HTMLInputElement(Document&, const String& tag_name);
|
||||
HTMLInputElement(Document&, const FlyString& tag_name);
|
||||
virtual ~HTMLInputElement() override;
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
template<>
|
||||
inline bool is<HTMLInputElement>(const Node& node)
|
||||
{
|
||||
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "input";
|
||||
return is<Element>(node) && to<Element>(node).tag_name().equals_ignoring_case("input");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user