LibWeb/HTML: Implement CloseWatcher::getEnabledState closer to spec

We previously had this implemented in an ad-hoc way, where we used a
boolean on the CloseWatcher instead of a proper function with steps.
This worked at the time, but causes problems with the current version
of the spec, so let's just implement it properly.

This commit consciously does not update the spec text, because it's
diverted quite a lot. That will happen in a subsequent commit.
This commit is contained in:
Sam Atkins 2025-12-01 17:14:29 +00:00
parent c541d14232
commit a1fbcfb4c6
Notes: github-actions[bot] 2025-12-04 14:48:26 +00:00
5 changed files with 54 additions and 27 deletions

View file

@ -70,6 +70,9 @@ private:
GC::Ptr<DOM::Element> m_request_close_source_element;
GC::Ptr<CloseWatcher> m_close_watcher;
// https://html.spec.whatwg.org/multipage/interactive-elements.html#enable-close-watcher-for-requestclose()
bool m_enable_close_watcher_for_request_close { false };
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dialog-toggle-task-tracker
Optional<ToggleTaskTracker> m_dialog_toggle_task_tracker;