-
Notifications
You must be signed in to change notification settings - Fork 36
Close requests and close watchers #215
Copy link
Copy link
Closed
Labels
from: GoogleProposed, edited, or co-edited by Google.Proposed, edited, or co-edited by Google.position: neutraltopic: htmlSpec relates to HTML (Hypertext Markup Language)Spec relates to HTML (Hypertext Markup Language)topic: web apisSpec relates to web APIs (entry points for script)Spec relates to web APIs (entry points for script)venue: WHATWG HTML Workstreamvenue: WICGProposal is incubated in the Web Incubator Community GroupProposal is incubated in the Web Incubator Community Group
Metadata
Metadata
Assignees
Labels
from: GoogleProposed, edited, or co-edited by Google.Proposed, edited, or co-edited by Google.position: neutraltopic: htmlSpec relates to HTML (Hypertext Markup Language)Spec relates to HTML (Hypertext Markup Language)topic: web apisSpec relates to web APIs (entry points for script)Spec relates to web APIs (entry points for script)venue: WHATWG HTML Workstreamvenue: WICGProposal is incubated in the Web Incubator Community GroupProposal is incubated in the Web Incubator Community Group
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Done

WebKittens
@annevk and @othermaciej have both previously reviewed this
Title of the spec
Close signals and close watchers
URL to the spec
https://html.spec.whatwg.org/multipage/interaction.html#close-requests-and-close-watchers
URL to the spec's repository
https://github.com/WICG/close-watcher
Issue Tracker URL
No response
Explainer URL
No response
TAG Design Review URL
w3ctag/design-reviews#594
Mozilla standards-positions issue URL
mozilla/standards-positions#604
WebKit Bugzilla URL
No response
Radar URL
No response
Description
In addition to the WICG repository with the explainer, see the HTML Standard pull request: whatwg/html#9462
The main new API introduced here is the
CloseWatcherAPI. But this spec also includes changes to unify dialog, popover, and fullscreen handling into a single "close watcher" concept, which is triggered by a platform-independent concept of "close request".For macOS and keyboard-attached iOS devices, the close request would be the Esc key. For other iOS devices, there might not be a close request. This was previously discussed in WICG/close-watcher#11 ; see also https://github.com/WICG/close-watcher/blob/main/platform-implementation-notes.md . In such cases, it would still be ideal for the API to exist and be implemented, and just never triggered via user action, so that developers can write platform-agnostic code (e.g. centralizing their close logic into the
closeevent handler of aCloseWatcherobject).Because of how close request gestures can serve multiple purposes, e.g. the Android back button/gesture being used to navigate session history, the specification has some anti-abuse measures to prevent the close signal gesture from being indefinitely captured by web developers using dialogs, popovers, or
CloseWatchers. These measures might not be necessary in the macOS/iOS-with-keyboard ecosystem, where the Esc key is the only relevant gesture and it does not serve another purpose. But we think they're still reasonable, and should be implemented uniformly across platforms for interoperability. This was previously discussed from one angle in WICG/close-watcher#10.