LibWeb: Stub out a few HTMLTextArea validity IDL methods

These are invoked by GitHub when submitting a comment. Stub them out for
now, as this is enough to let GitHub proceed with (attempting) to submit
the comment.
This commit is contained in:
Timothy Flynn 2024-03-06 14:44:05 -05:00 committed by Alexander Kalenik
parent 76f767c867
commit 50d3f85f75
Notes: sideshowbarker 2024-07-17 01:27:18 +09:00
3 changed files with 27 additions and 3 deletions

View file

@ -148,6 +148,26 @@ u32 HTMLTextAreaElement::text_length() const
return Utf16View { utf16_data }.length_in_code_units();
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-checkvalidity
bool HTMLTextAreaElement::check_validity()
{
dbgln("(STUBBED) HTMLTextAreaElement::check_validity(). Called on: {}", debug_description());
return true;
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-reportvalidity
bool HTMLTextAreaElement::report_validity()
{
dbgln("(STUBBED) HTMLTextAreaElement::report_validity(). Called on: {}", debug_description());
return true;
}
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-setcustomvalidity
void HTMLTextAreaElement::set_custom_validity(String const& error)
{
dbgln("(STUBBED) HTMLTextAreaElement::set_custom_validity(\"{}\"). Called on: {}", error, debug_description());
}
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-maxlength
WebIDL::Long HTMLTextAreaElement::max_length() const
{

View file

@ -79,6 +79,10 @@ public:
u32 text_length() const;
bool check_validity();
bool report_validity();
void set_custom_validity(String const& error);
WebIDL::Long max_length() const;
WebIDL::ExceptionOr<void> set_max_length(WebIDL::Long);

View file

@ -28,9 +28,9 @@ interface HTMLTextAreaElement : HTMLElement {
// FIXME: readonly attribute boolean willValidate;
// FIXME: readonly attribute ValidityState validity;
// FIXME: readonly attribute DOMString validationMessage;
// FIXME: boolean checkValidity();
// FIXME: boolean reportValidity();
// FIXME: undefined setCustomValidity(DOMString error);
boolean checkValidity();
boolean reportValidity();
undefined setCustomValidity(DOMString error);
// FIXME: readonly attribute NodeList labels;