diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-21 11:39:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-21 11:39:32 +0200 |
commit | a64033e581bd82816051456cb1e3b6b21762c543 (patch) | |
tree | b6e4721d2f0e2bf57e2e0754c9d38bf28fa54051 /Libraries/LibWeb/DOM/Element.h | |
parent | 5eb39a5f61a2617e795b26ba95bc73d83d43a195 (diff) | |
download | serenity-a64033e581bd82816051456cb1e3b6b21762c543.zip |
LibWeb: Generate Element bindings from IDL :^)
Had to do a bunch more hacking on WrapperGenerator to support this.
We now support attribute setters as well.
Diffstat (limited to 'Libraries/LibWeb/DOM/Element.h')
-rw-r--r-- | Libraries/LibWeb/DOM/Element.h | 4 |
1 files changed, 4 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; |