LibWeb: Implement the ToggleEvent.source attribute

See: https://github.com/whatwg/html/pull/11186
This commit is contained in:
Gingeh 2025-06-04 15:35:43 +10:00 committed by Tim Ledbetter
parent 82f9b51da6
commit fc35229dab
Notes: github-actions[bot] 2025-06-07 03:07:15 +00:00
13 changed files with 297 additions and 88 deletions

View file

@ -61,9 +61,9 @@ void PopoverInvokerElement::popover_target_activation_behaviour(GC::Ref<DOM::Nod
&& popover->popover_visibility_state() == HTMLElement::PopoverVisibilityState::Hidden)
return;
// 6. If popover's popover visibility state is showing, then run the hide popover algorithm given popover, true, true, false, and false.
// 6. If popover's popover visibility state is showing, then run the hide popover algorithm given popover, true, true, false, false, and node.
if (popover->popover_visibility_state() == HTMLElement::PopoverVisibilityState::Showing) {
MUST(popover->hide_popover(FocusPreviousElement::Yes, FireEvents::Yes, ThrowExceptions::No, IgnoreDomState::No));
MUST(popover->hide_popover(FocusPreviousElement::Yes, FireEvents::Yes, ThrowExceptions::No, IgnoreDomState::No, as<HTMLElement>(*node)));
}
// 7. Otherwise, if popover's popover visibility state is hidden and the result of running check popover validity given popover, false, false, null, and false is true, then run show popover given popover, false, and node.