diff options
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r-- | Libraries/LibWeb/DOM/Element.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Element.idl | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 547b6b21e3..70f93dbdc5 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -50,6 +50,7 @@ public: bool has_attribute(const FlyString& name) const { return !attribute(name).is_null(); } String attribute(const FlyString& name) const; + String get_attribute(const FlyString& name) const { return attribute(name); } void set_attribute(const FlyString& name, const String& value); void set_attributes(Vector<Attribute>&&); @@ -80,6 +81,9 @@ public: String inner_html() const; void set_inner_html(StringView); + String id() const { return attribute(HTML::AttributeNames::id); } + void set_id(const String& value) { set_attribute(HTML::AttributeNames::id, value); } + protected: RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override; diff --git a/Libraries/LibWeb/DOM/Element.idl b/Libraries/LibWeb/DOM/Element.idl new file mode 100644 index 0000000000..af914db646 --- /dev/null +++ b/Libraries/LibWeb/DOM/Element.idl @@ -0,0 +1,10 @@ +interface Element : Node { + + DOMString? getAttribute(DOMString qualifiedName); + void setAttribute(DOMString qualifiedName, DOMString value); + + attribute DOMString innerHTML; + attribute DOMString id; + +} + |