Bug 227534

Summary: Implement support for <dialog> element cancel event
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: DOMAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, clopez, dbarton, esprehn+autocc, ews-watchlist, fred.wang, gyuyoung.kim, kangil.han, kondapallykalyan, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 227800, 228822    
Bug Blocks: 84635    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Tim Nguyen (:ntim) 2021-06-30 09:37:39 PDT
Pressing "Esc" should "cancel" the dialog: e.g. close it, and emit a "cancel" event.
Comment 1 Tim Nguyen (:ntim) 2021-06-30 09:48:53 PDT
This is only for modal dialogs.
Comment 2 Radar WebKit Bug Importer 2021-06-30 09:49:10 PDT
<rdar://problem/79971694>
Comment 3 Tim Nguyen (:ntim) 2021-07-12 06:20:24 PDT
Created attachment 433314 [details]
Patch
Comment 4 Tim Nguyen (:ntim) 2021-08-05 10:42:48 PDT
Created attachment 435004 [details]
Patch
Comment 5 EWS Watchlist 2021-08-05 10:43:45 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 6 Tim Nguyen (:ntim) 2021-08-05 11:09:10 PDT
WPT PR: https://github.com/web-platform-tests/wpt/pull/29917
Comment 7 Chris Dumez 2021-08-05 12:49:17 PDT
Comment on attachment 435004 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435004&action=review

r=me

> Source/WebCore/page/EventHandler.cpp:3514
> +    if (HTMLDialogElement* activeModalDialog = m_frame.document()->activeModalDialog()) {

auto*
Comment 8 Tim Nguyen (:ntim) 2021-08-05 13:46:08 PDT
Created attachment 435021 [details]
Patch
Comment 9 Tim Nguyen (:ntim) 2021-08-05 13:57:04 PDT
Committed r280703 (240299@main): <https://commits.webkit.org/240299@main>