LibWeb: Implement the labels attribute for all labelable elements

This returns a `NodeList` of all the labels associated with the given
element.
This commit is contained in:
Tim Ledbetter 2024-05-18 14:10:00 +01:00 committed by Andreas Kling
commit 2447a25753
Notes: sideshowbarker 2024-07-16 20:39:14 +09:00
11 changed files with 89 additions and 7 deletions

View file

@ -68,6 +68,8 @@ public:
// https://html.spec.whatwg.org/multipage/forms.html#category-label
virtual bool is_labelable() const { return false; }
JS::GCPtr<DOM::NodeList> labels();
virtual Optional<ARIA::Role> default_role() const override;
String get_an_elements_target() const;
@ -93,6 +95,8 @@ private:
JS::GCPtr<DOMStringMap> m_dataset;
JS::GCPtr<DOM::NodeList> m_labels;
enum class ContentEditableState {
True,
False,