1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +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:
Andreas Kling 2020-06-03 20:51:28 +02:00
parent ff55d00261
commit 2149820260
16 changed files with 71 additions and 43 deletions

View file

@ -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();