summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Attribute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Attribute.cpp')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Attribute.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Attribute.cpp b/Userland/Libraries/LibWeb/DOM/Attribute.cpp
new file mode 100644
index 0000000000..996a80a404
--- /dev/null
+++ b/Userland/Libraries/LibWeb/DOM/Attribute.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/DOM/Attribute.h>
+#include <LibWeb/DOM/Document.h>
+
+namespace Web::DOM {
+
+NonnullRefPtr<Attribute> Attribute::create(Document& document, FlyString local_name, String value)
+{
+ return adopt_ref(*new Attribute(document, move(local_name), move(value)));
+}
+
+Attribute::Attribute(Document& document, FlyString local_name, String value)
+ : Node(document, NodeType::ATTRIBUTE_NODE)
+ , m_qualified_name(move(local_name), {}, {})
+ , m_value(move(value))
+{
+}
+
+}