mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 06:59:47 +00:00
LibWeb/HTML: Correctly compute whether element is mutable
This adapts the implementation of `is_mutable` to align more closely with the spec. Specifically, it is now also taken into account whether the element is enabled.
This commit is contained in:
parent
1228063a85
commit
cac2ee41b9
Notes:
github-actions[bot]
2025-08-14 15:07:22 +00:00
Author: https://github.com/skyz1
Commit: cac2ee41b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5812
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/trflynn89
10 changed files with 171 additions and 63 deletions
|
@ -145,6 +145,9 @@ public:
|
|||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-setcustomvalidity
|
||||
void set_custom_validity(String& error);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#mutability
|
||||
virtual bool is_mutable() const { return true; }
|
||||
|
||||
protected:
|
||||
FormAssociatedElement() = default;
|
||||
virtual ~FormAssociatedElement() = default;
|
||||
|
@ -220,9 +223,6 @@ public:
|
|||
bool has_scheduled_selectionchange_event() const { return m_has_scheduled_selectionchange_event; }
|
||||
void set_scheduled_selectionchange_event(bool value) { m_has_scheduled_selectionchange_event = value; }
|
||||
|
||||
bool is_mutable() const { return m_is_mutable; }
|
||||
void set_is_mutable(bool is_mutable) { m_is_mutable = is_mutable; }
|
||||
|
||||
virtual void did_edit_text_node() = 0;
|
||||
|
||||
virtual GC::Ptr<DOM::Text> form_associated_element_to_text_node() = 0;
|
||||
|
@ -260,9 +260,6 @@ private:
|
|||
|
||||
// https://w3c.github.io/selection-api/#dfn-has-scheduled-selectionchange-event
|
||||
bool m_has_scheduled_selectionchange_event { false };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#mutability
|
||||
bool m_is_mutable { true };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue