LibWeb: Ignore DOM state when hiding removed popovers

Using https://github.com/whatwg/html/pull/9457
(with some changes made to catch up with the current spec)
to fix a spec bug and a crash when removing a visible popover.
This commit is contained in:
Gingeh 2025-01-14 11:06:06 +11:00 committed by Andrew Kaster
commit e670caeb0c
Notes: github-actions[bot] 2025-01-30 22:49:36 +00:00
5 changed files with 51 additions and 32 deletions

View file

@ -60,6 +60,11 @@ enum class ExpectedToBeShowing {
No,
};
enum class IgnoreDomState {
Yes,
No,
};
class HTMLElement
: public DOM::Element
, public HTML::GlobalEventHandlers
@ -131,9 +136,9 @@ public:
WebIDL::ExceptionOr<void> hide_popover_for_bindings();
WebIDL::ExceptionOr<bool> toggle_popover(TogglePopoverOptionsOrForceBoolean const&);
WebIDL::ExceptionOr<bool> check_popover_validity(ExpectedToBeShowing expected_to_be_showing, ThrowExceptions throw_exceptions, GC::Ptr<DOM::Document>);
WebIDL::ExceptionOr<bool> check_popover_validity(ExpectedToBeShowing expected_to_be_showing, ThrowExceptions throw_exceptions, GC::Ptr<DOM::Document>, IgnoreDomState ignore_dom_state);
WebIDL::ExceptionOr<void> show_popover(ThrowExceptions throw_exceptions, GC::Ptr<HTMLElement> invoker);
WebIDL::ExceptionOr<void> hide_popover(FocusPreviousElement focus_previous_element, FireEvents fire_events, ThrowExceptions throw_exceptions);
WebIDL::ExceptionOr<void> hide_popover(FocusPreviousElement focus_previous_element, FireEvents fire_events, ThrowExceptions throw_exceptions, IgnoreDomState ignore_dom_state);
protected:
HTMLElement(DOM::Document&, DOM::QualifiedName);