mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +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
|
@ -55,10 +55,10 @@ private:
|
|||
|
||||
class Element : public ParentNode {
|
||||
public:
|
||||
Element(Document&, const String& tag_name);
|
||||
Element(Document&, const FlyString& tag_name);
|
||||
virtual ~Element() override;
|
||||
|
||||
virtual String tag_name() const final { return m_tag_name; }
|
||||
virtual FlyString tag_name() const final { return m_tag_name; }
|
||||
|
||||
bool has_attribute(const FlyString& name) const { return !attribute(name).is_null(); }
|
||||
String attribute(const FlyString& name) const;
|
||||
|
@ -94,7 +94,7 @@ private:
|
|||
Attribute* find_attribute(const FlyString& name);
|
||||
const Attribute* find_attribute(const FlyString& name) const;
|
||||
|
||||
String m_tag_name;
|
||||
FlyString m_tag_name;
|
||||
Vector<Attribute> m_attributes;
|
||||
|
||||
RefPtr<StyleProperties> m_resolved_style;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue