-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close watchers: detecting close requests vs. other closes #10047
Labels
Comments
Hmm, I forgot that my plan was to fire |
Did #10168 fix this issue? |
No, we still need to update the spec and tests to fire uncancelable cancel events. |
domenic
added a commit
that referenced
this issue
Apr 22, 2024
Previously, the anti-abuse mechanisms would sometimes skip these events. However, as discussed in #10047, it is more useful to fire them, and have the anti-abuse mechanisms set cancelable to false for them when appropriate. This allows observing close requests vs. other types of closes, by looking for the cancel event. Closes #10047.
domenic
added a commit
that referenced
this issue
Apr 22, 2024
Previously, the anti-abuse mechanisms would sometimes skip these events. However, as discussed in #10047, it is more useful to fire them, and have the anti-abuse mechanisms set cancelable to false for them when appropriate. This allows observing close requests vs. other types of closes, by looking for the cancel event. Closes #10047.
5 tasks
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 22, 2024
Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088
aarongable
pushed a commit
to chromium/chromium
that referenced
this issue
Apr 23, 2024
Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 23, 2024
Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 23, 2024
Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Apr 25, 2024
…s, a=testonly Automatic update from web-platform-tests Close watchers: always fire cancel events Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009} -- wpt-commits: 69f5a6f1e296d9b51552db976b2ffe37c72dd472 wpt-pr: 45818
ErichDonGubler
pushed a commit
to erichdongubler-mozilla/firefox
that referenced
this issue
Apr 30, 2024
…s, a=testonly Automatic update from web-platform-tests Close watchers: always fire cancel events Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009} -- wpt-commits: 69f5a6f1e296d9b51552db976b2ffe37c72dd472 wpt-pr: 45818
domenic
added a commit
that referenced
this issue
May 10, 2024
Previously, the anti-abuse mechanisms would sometimes skip these events. However, as discussed in #10047, it is more useful to fire them, and have the anti-abuse mechanisms set cancelable to false for them when appropriate. This allows observing close requests vs. other types of closes, by looking for the cancel event. Closes #10047.
i3roly
pushed a commit
to i3roly/firefox-dynasty
that referenced
this issue
Jun 1, 2024
…s, a=testonly Automatic update from web-platform-tests Close watchers: always fire cancel events Sometimes they will have cancelable = false, but they will now always fire. See whatwg/html#10047. Bug: 41484805, 40054591 Change-Id: Ica682043fb56c729f4c331e9f3bd0590d3b1d088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465306 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291009} -- wpt-commits: 69f5a6f1e296d9b51552db976b2ffe37c72dd472 wpt-pr: 45818
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the issue with the HTML Standard?
In https://bugs.chromium.org/p/chromium/issues/detail?id=1512224, especially this comment, I was made aware that developers were using
<dialog>
'scancel
event as a way of detecting when a close request was issued vs. whether the dialog was closed in some other way.This conflicts a bit with the changes introduced in #9462. There, the close watcher infrastructure only fires
cancel
if it'spreventDefault()
-able, so that web developers can callcancelEvent.preventDefault()
and stop the dialog or close watcher from closing. When designing that infrastructure, I didn't realize that people might be usingcancel
for this sort of informational purpose; I thought they would only use it to intervene.To accomplish this use case, of detecting close requests, two solutions come to mind:
close
event, e.g.fromCloseRequest
oruserInitiated
or something.cancel
anyway, but makecancelEvent.cancelable
false when the anti-abuse protections do not allow callingpreventDefault()
. This automatically makes it so thatcancelEvent.preventDefault()
does nothing.For both options, we have the choice of whether to apply them just to
<dialog>
, or to apply them also toCloseWatcher
.I'm currently leaning toward the second option, as it does not require web developers to change their code. However, based on our measurements from shipping #9462, only 0.000015% of page views experienced a change in the number of
cancel
events fired, so it isn't required that we take that path. (And, after fixing #10046, that 0.000015% number will go even lower.)My plan is to write up the spec changes for "fire
cancel
anyway", for both<dialog>
andCloseWatcher
, and see how it feels. If it's very ugly or there's some unintended consequence that I didn't understand, I'll revisit and consider "add a property to theclose
event"./cc @josepharhar @lukewarlow
The text was updated successfully, but these errors were encountered: