LibWeb: Expose three more attribute methods on Element
Exposes removeAttribute, hasAttribute and hasAttributes.
This commit is contained in:
parent
b05f048c05
commit
18d99919be
Notes:
sideshowbarker
2024-07-19 00:25:50 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/18d99919be2 Pull-request: https://github.com/SerenityOS/serenity/pull/4640
2 changed files with 4 additions and 0 deletions
|
@ -60,6 +60,7 @@ public:
|
|||
const FlyString& namespace_uri() const { return namespace_(); }
|
||||
|
||||
bool has_attribute(const FlyString& name) const { return !attribute(name).is_null(); }
|
||||
bool has_attributes() const { return !m_attributes.is_empty(); }
|
||||
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);
|
||||
|
|
|
@ -4,6 +4,9 @@ interface Element : Node {
|
|||
|
||||
DOMString? getAttribute(DOMString qualifiedName);
|
||||
undefined setAttribute(DOMString qualifiedName, DOMString value);
|
||||
undefined removeAttribute(DOMString qualifiedName);
|
||||
boolean hasAttribute(DOMString qualifiedName);
|
||||
boolean hasAttributes();
|
||||
|
||||
readonly attribute Element? firstElementChild;
|
||||
readonly attribute Element? lastElementChild;
|
||||
|
|
Loading…
Add table
Reference in a new issue