github web-platform-tests/wpt merge_pr_49223

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
9 months ago

Fix dialog.requestClose() in two ways

  1. The prior implementation ignored the argument to requestClose.
    With this CL, requestClose(string) stores away string and then
    returns it from the CloseWatcher close event.
  2. If the dialog's closedBy state is None (either explicitly or
    through the "Auto" state), requestClose throws an exception.

I also added a more significant set of tests for requestClose() in
all states.

This goes along with recent discussion about throwing exceptions if
requestClose() is called when the dialog isn't in the right state,
relative to closedBy:

whatwg/html#10164 (comment)

The spec PR has been updated accordingly:

whatwg/html#10737

Bug: 376516550
Change-Id: I023845844e6afb4da9a71637d517ac78d2861329
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026242
Auto-Submit: Mason Freed masonf@chromium.org
Reviewed-by: David Baron dbaron@chromium.org
Commit-Queue: David Baron dbaron@chromium.org
Cr-Commit-Position: refs/heads/main@{#1384345}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.