mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 15:01:54 +00:00
LibWeb/HTML: Implement and use "optional value"
Corresponds to f3444c23ff
Also import a test.
This commit is contained in:
parent
22cc36eeaa
commit
af17f38bbf
Notes:
github-actions[bot]
2025-07-08 16:10:58 +00:00
Author: https://github.com/AtkinsSJ
Commit: af17f38bbf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5353
Reviewed-by: https://github.com/tcl3 ✅
9 changed files with 228 additions and 7 deletions
|
@ -492,16 +492,14 @@ void HTMLDialogElement::invoker_command_steps(DOM::Element& invoker, String& com
|
|||
// 2. If command is in the Close state and element has an open attribute,
|
||||
// then close the dialog given element with invoker's optional value and invoker.
|
||||
if (command == "close" && has_attribute(AttributeNames::open)) {
|
||||
// FIXME: This assumes invoker is a button.
|
||||
auto optional_value = invoker.get_attribute(AttributeNames::value);
|
||||
auto const optional_value = as<FormAssociatedElement>(invoker).optional_value();
|
||||
close_the_dialog(optional_value, invoker);
|
||||
}
|
||||
|
||||
// 3. If command is in the Request Close state and element has an open attribute,
|
||||
// then request to close the dialog element with invoker's optional value and invoker.
|
||||
if (command == "request-close" && has_attribute(AttributeNames::open)) {
|
||||
// FIXME: This assumes invoker is a button.
|
||||
auto optional_value = invoker.get_attribute(AttributeNames::value);
|
||||
auto const optional_value = as<FormAssociatedElement>(invoker).optional_value();
|
||||
request_close_the_dialog(optional_value, invoker);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue