LibWeb: Update button activation behaviour to match spec
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

See: https://github.com/whatwg/html/pull/11248
See: https://github.com/whatwg/html/pull/11325
This commit is contained in:
Gingeh 2025-05-22 14:53:53 +10:00 committed by Sam Atkins
parent f1eaecc630
commit 71222df4c4
Notes: github-actions[bot] 2025-05-22 06:56:35 +00:00

View file

@ -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,