Skip to content

Commit 36042af

Browse files
mfreed7chromium-wpt-export-bot
authored andcommitted
Make closeWatcher.requestClose() not require user activation
Per the conversation here: openui/open-ui#1128 (comment) There's a desire to ship closeWatcher.requestClose() along with dialog.requestclose() both not requiring user activation. The spec PR has been updated accordingly: whatwg/html#10737 (in this commit: whatwg/html@76619aa) Fixed: 383593252 Change-Id: I8c05e352d8b4964407a1cee36f35372e192e2ca5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6092173 Auto-Submit: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1396007}
1 parent 24f3b8d commit 36042af

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

close-watcher/basic.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
watcher.requestClose();
1616

17-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
17+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
1818
}, "requestClose() with no user activation");
1919

2020
test(t => {
@@ -43,10 +43,10 @@
4343
let watcher = createRecordingCloseWatcher(t, events);
4444

4545
watcher.requestClose();
46-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
46+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
4747

4848
watcher.destroy();
49-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
49+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
5050
}, "requestClose() then destroy()");
5151

5252
test(t => {

close-watcher/inside-event-listeners.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
watcher.onclose = () => { watcher.destroy(); }
3131

3232
watcher.requestClose();
33-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
33+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
3434

3535
watcher.requestClose();
36-
assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired");
36+
assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired");
3737
}, "destroy() inside onclose");
3838

3939
promise_test(async t => {
@@ -58,10 +58,10 @@
5858
watcher.onclose = () => { watcher.close(); }
5959

6060
watcher.requestClose();
61-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
61+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
6262

6363
watcher.requestClose();
64-
assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired");
64+
assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired");
6565
}, "close() inside onclose");
6666

6767
promise_test(async t => {
@@ -86,9 +86,9 @@
8686
watcher.onclose = () => { watcher.requestClose(); }
8787

8888
watcher.requestClose();
89-
assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
89+
assert_array_equals(events, ["cancel[cancelable=true]", "close"]);
9090

9191
watcher.requestClose();
92-
assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired");
92+
assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired");
9393
}, "requestClose() inside onclose");
9494
</script>

0 commit comments

Comments
 (0)