mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:35:08 +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:
parent
c4a6d6ae9f
commit
7309642ca8
48 changed files with 67 additions and 63 deletions
|
@ -32,14 +32,14 @@ namespace Web {
|
|||
|
||||
class HTMLHtmlElement : public HTMLElement {
|
||||
public:
|
||||
HTMLHtmlElement(Document&, const String& tag_name);
|
||||
HTMLHtmlElement(Document&, const FlyString& tag_name);
|
||||
virtual ~HTMLHtmlElement() override;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<HTMLHtmlElement>(const Node& node)
|
||||
{
|
||||
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "html";
|
||||
return is<Element>(node) && to<Element>(node).tag_name().equals_ignoring_case("html");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue