1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibWeb: Move Attribute to its own header file

This will allow us to use it without including Element.h
This commit is contained in:
Andreas Kling 2020-05-22 21:45:00 +02:00
parent f03e452085
commit 120cd44011
2 changed files with 53 additions and 19 deletions

View file

@ -28,6 +28,7 @@
#include <AK/FlyString.h>
#include <AK/String.h>
#include <LibWeb/DOM/Attribute.h>
#include <LibWeb/DOM/ParentNode.h>
#include <LibWeb/Layout/LayoutNode.h>
@ -35,24 +36,6 @@ namespace Web {
class LayoutNodeWithStyle;
class Attribute {
public:
Attribute(const FlyString& name, const String& value)
: m_name(name)
, m_value(value)
{
}
const FlyString& name() const { return m_name; }
const String& value() const { return m_value; }
void set_value(const String& value) { m_value = value; }
private:
FlyString m_name;
String m_value;
};
class Element : public ParentNode {
public:
using WrapperType = Bindings::ElementWrapper;
@ -77,7 +60,7 @@ public:
bool has_class(const StringView&) const;
virtual void apply_presentational_hints(StyleProperties&) const {}
virtual void apply_presentational_hints(StyleProperties&) const { }
virtual void parse_attribute(const FlyString& name, const String& value);
void recompute_style();