mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibWeb: Update button activation behaviour to match spec
See: https://github.com/whatwg/html/pull/11248 See: https://github.com/whatwg/html/pull/11325
This commit is contained in:
parent
f1eaecc630
commit
71222df4c4
Notes:
github-actions[bot]
2025-05-22 06:56:35 +00:00
Author: https://github.com/Gingeh
Commit: 71222df4c4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4839
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 2 additions and 5 deletions
|
@ -155,7 +155,7 @@ void HTMLButtonElement::activation_behavior(DOM::Event const& event)
|
|||
return;
|
||||
}
|
||||
|
||||
// 4. Let target be the result of running element's get the commandfor associated element.
|
||||
// 4. Let target be the result of running element's get the commandfor-associated element.
|
||||
// AD-HOC: Target needs to be an HTML Element in the following steps.
|
||||
GC::Ptr<HTMLElement> target = as_if<HTMLElement>(m_command_for_element.ptr());
|
||||
if (!target) {
|
||||
|
@ -186,7 +186,7 @@ void HTMLButtonElement::activation_behavior(DOM::Event const& event)
|
|||
|
||||
// 4. If isPopover is false and command is not in the Custom state:
|
||||
auto command_is_in_custom_state = command.starts_with_bytes("--"sv);
|
||||
if (!is_popover && !command.starts_with_bytes("--"sv)) {
|
||||
if (!is_popover && !command_is_in_custom_state) {
|
||||
// 1. Assert: target's namespace is the HTML namespace.
|
||||
VERIFY(target->namespace_uri() == Namespace::HTML);
|
||||
|
||||
|
@ -220,9 +220,6 @@ void HTMLButtonElement::activation_behavior(DOM::Event const& event)
|
|||
if (command_is_in_custom_state)
|
||||
return;
|
||||
|
||||
// AD-HOC: The parameters provided in the spec do not match the function signatures in the following steps.
|
||||
// The inconsistent parameters were therefore selected ad hoc.
|
||||
|
||||
// 9. If command is in the Hide Popover state:
|
||||
if (command == "hide-popover") {
|
||||
// 1. If the result of running check popover validity given target, true, false, and null is true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue