mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Implement validity IDL attribute
This commit is contained in:
parent
184ae687c5
commit
83c4e22247
Notes:
github-actions[bot]
2025-02-18 06:38:10 +00:00
Author: https://github.com/Psychpsyo
Commit: 83c4e22247
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3583
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/tcl3 ✅
33 changed files with 2007 additions and 31 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <LibWeb/HTML/HTMLSelectElement.h>
|
||||
#include <LibWeb/HTML/HTMLTextAreaElement.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
#include <LibWeb/HTML/ValidityState.h>
|
||||
#include <LibWeb/Painting/Paintable.h>
|
||||
#include <LibWeb/Selection/Selection.h>
|
||||
|
||||
|
@ -48,6 +49,13 @@ void FormAssociatedElement::set_form(HTMLFormElement* form)
|
|||
m_form->add_associated_element({}, form_associated_element_to_html_element());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-validity
|
||||
GC::Ref<ValidityState const> FormAssociatedElement::validity() const
|
||||
{
|
||||
auto& realm = form_associated_element_to_html_element().realm();
|
||||
return realm.create<ValidityState>(realm, *this);
|
||||
}
|
||||
|
||||
bool FormAssociatedElement::enabled() const
|
||||
{
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue