mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
LibWeb: Use HTML::AttributeNames::foo instead of FlyString("foo")
To avoid the costly instantiation of FlyStrings whenever we're looking up attributes, use the premade HTML::AttributeNames globals. :^)
This commit is contained in:
parent
ff55d00261
commit
2149820260
Notes:
sideshowbarker
2024-07-19 05:51:40 +09:00
Author: https://github.com/awesomekling
Commit: 2149820260
16 changed files with 71 additions and 43 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <AK/FlyString.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibWeb/DOM/Attribute.h>
|
||||
#include <LibWeb/DOM/AttributeNames.h>
|
||||
#include <LibWeb/DOM/ParentNode.h>
|
||||
#include <LibWeb/Layout/LayoutNode.h>
|
||||
|
||||
|
@ -68,7 +69,7 @@ public:
|
|||
LayoutNodeWithStyle* layout_node() { return static_cast<LayoutNodeWithStyle*>(Node::layout_node()); }
|
||||
const LayoutNodeWithStyle* layout_node() const { return static_cast<const LayoutNodeWithStyle*>(Node::layout_node()); }
|
||||
|
||||
String name() const { return attribute("name"); }
|
||||
String name() const { return attribute(HTML::AttributeNames::name); }
|
||||
|
||||
const StyleProperties* resolved_style() const { return m_resolved_style.ptr(); }
|
||||
NonnullRefPtr<StyleProperties> computed_style();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue