mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-08 16:12:23 +02:00
LibWeb/HTML: Implement and use "optional value"
Corresponds to f3444c23ff
Also import a test.
This commit is contained in:
committed by
Tim Ledbetter
parent
22cc36eeaa
commit
af17f38bbf
Notes:
github-actions[bot]
2025-07-08 16:10:58 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/af17f38bbf6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5353 Reviewed-by: https://github.com/tcl3 ✅
@@ -225,9 +225,10 @@ WebIDL::ExceptionOr<void> HTMLFormElement::submit_form(GC::Ref<HTMLElement> subm
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Otherwise, if submitter has a value, then set result to that value.
|
||||
if (!result.has_value())
|
||||
result = submitter->get_attribute_value(AttributeNames::value);
|
||||
// 5. Otherwise, if submitter is a submit button, then set result to submitter's optional value.
|
||||
else if (auto* form_associated_element = as_if<FormAssociatedElement>(*submitter); form_associated_element && form_associated_element->is_submit_button()) {
|
||||
result = form_associated_element->optional_value();
|
||||
}
|
||||
|
||||
// 6. Close the dialog subject with result and null.
|
||||
subject->close_the_dialog(move(result), nullptr);
|
||||
|
||||
Reference in New Issue
Block a user