[w3ctag/design-reviews] Dispatching Toggle Events for Dialog open/close (Issue #1005)

こんにちは TAG-さん!

I'm requesting a TAG review of Dispatching Toggle Events for Dialog open/close.

It is useful for web authors do determine when their `<dialog>` elements open and close. `popover` already has `ToggleEvent` which is dispatched when a `popover` opens or closes, but `<dialog>` does not. The current way to detect when a `<dialog>` opens is to register a mutation observer to check for `open`, however, this is quite a lot of work where an event would be easier.

I propose we add dispatching of `ToggleEvent` for `<dialog>` also. To be explicit: when `show` or `showModal` is called, `<dialog>` should dispatch a `ToggleEvent` with `newState=open`. When a dialog is closed (via form or button or close signal) it should dispatch a `ToggleEvent` with `newState=closed`.

  - Explainer¹: https://github.com/whatwg/html/issues/9733
  - Specification: https://github.com/whatwg/html/pull/10091
  - WPT Tests: https://wpt.fyi/results/html/semantics/interactive-elements/the-dialog-element/toggle-events.tentative.html
  - User research:
  - Security and Privacy self-review²: N/A
  - GitHub repo: https://github.com/whatwg/html
  - Primary contacts:
      - Keith Cirkel (@keithamus), GitHub, author/implementer
      - Joey Arhar (@jarhar), Google, implementer
  - Organization/project driving the specification: GitHub
  - Multi-stakeholder support³:
    - Chromium comments: Positive
    - Mozilla comments: https://github.com/mozilla/standards-positions/issues/1101 Positive - shipping in nightly
    - WebKit comments: https://github.com/WebKit/standards-positions/issues/418 No Signal
    - Developers: GitHub Positive :wink:
  - Status/issue trackers for implementations⁴: https://bugzilla.mozilla.org/show_bug.cgi?id=1876762, https://bugs.webkit.org/show_bug.cgi?id=268160, https://issues.chromium.org/issues/41494780

Further details:

  - [x] I have reviewed the TAG's [Web Platform Design Principles](https://www.w3.org/TR/design-principles/)
  - Relevant time constraints or deadlines: Ideally in the next 2 weeks so we can continue to ship in Firefox.
  - The group where the work on this specification is currently being done: whatwg
  - The group where standardization of this work is intended to be done (if different from the current group): whatwg
  - Major unresolved issues with or opposition to this specification: None
  - This work is being funded by: GitHub

You should also know that...

I've enabled this in Firefox nightly targeting 133, it is currently flagged in Chromium, but I've raised an I2S (https://groups.google.com/a/chromium.org/g/blink-dev/c/PxluqSXWXD4/m/7q3qwklWAAAJ) and I'm aiming to ship in M132. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1005
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1005@github.com>

Received on Thursday, 17 October 2024 08:23:41 UTC