LibWeb/HTML: Bring HTMLDialogElement up to spec

I missed when these changes actually happened, but the big differences
here are that a few steps got extracted into their own algorithms; and
the dialog now only does things when it's attached to a fully-active
document, instead of immediately.

I've imported a WPT test that exercises this by calling show() on an
unattached dialog.
This commit is contained in:
Sam Atkins 2025-12-01 17:26:50 +00:00
parent a1fbcfb4c6
commit 58b32814e0
Notes: github-actions[bot] 2025-12-04 14:48:20 +00:00
3 changed files with 155 additions and 79 deletions

View file

@ -56,8 +56,13 @@ private:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual void inserted() override;
virtual void attribute_changed(FlyString const& local_name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
void queue_a_dialog_toggle_event_task(String old_state, String new_state, GC::Ptr<DOM::Element> source);
void run_dialog_setup_steps();
void run_dialog_cleanup_steps();
void run_dialog_focusing_steps();
void set_close_watcher();