Bug 228845 - preventDefault() on keydown event should prevent dialog cancelation from happening
Summary: preventDefault() on keydown event should prevent dialog cancelation from happ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on: 229475
Blocks: dialog-element
  Show dependency treegraph
 
Reported: 2021-08-05 14:56 PDT by Tim Nguyen (:ntim)
Modified: 2021-08-24 16:21 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.99 KB, patch)
2021-08-24 03:36 PDT, Tim Nguyen (:ntim)
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2021-08-05 14:56:44 PDT
This is covered by dialog-keydown-preventDefault.html: https://github.com/web-platform-tests/wpt/blob/master/html/semantics/interactive-elements/the-dialog-element/dialog-keydown-preventDefault.html

Not sure if there are any other events that should also prevent dialog cancelation, but they should be covered by tests as well if so.
Comment 1 Radar WebKit Bug Importer 2021-08-11 13:40:44 PDT
<rdar://problem/81811203>
Comment 2 Tim Nguyen (:ntim) 2021-08-24 03:36:54 PDT
Created attachment 436273 [details]
Patch
Comment 3 Tim Nguyen (:ntim) 2021-08-24 05:57:54 PDT
Committed r281492 (240866@main): <https://commits.webkit.org/240866@main>
Comment 4 Ryosuke Niwa 2021-08-24 11:01:55 PDT
Comment on attachment 436273 [details]
Patch

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

> Source/WebCore/page/EventHandler.cpp:3804
> +            if (auto* activeModalDialog = m_frame.document()->activeModalDialog())

Use RefPtr

> Source/WebCore/page/EventHandler.cpp:3812
> +

Why are we adding a blank line here?