Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a36c2bb72d42d5b1fc800fbac095be534af8a1f9
      
https://github.com/WebKit/WebKit/commit/a36c2bb72d42d5b1fc800fbac095be534af8a1f9
  Author: Luke Warlow <[email protected]>
  Date:   2026-05-21 (Thu, 21 May 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/close-watcher/esc-key/synthetic-keyboard-event.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-synthetic-keydown-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-synthetic-keydown.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-synthetic-keydown-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-synthetic-keydown.html
    M Source/WebCore/html/closewatcher/CloseWatcherManager.cpp
    M Source/WebCore/html/closewatcher/CloseWatcherManager.h
    M Source/WebCore/page/EventHandler.cpp

  Log Message:
  -----------
  Genericise escapeKeyHandler in CloseWatcherManager
https://bugs.webkit.org/show_bug.cgi?id=315206

Reviewed by Anne van Kesteren.

Replaces escapeKeyHandler with a more generic processCloseWatchers function. 
This
will be useful to support new types of close signal in future.

Close Watchers are behind the testableCloseWatcherEnabled flag.

Also adds tests regarding untrusted escape keydown events.

The existing close watcher synthetic event test didn't actually test
what it intended to as it targeted the window instead of document.body.
As it's a test that nothing happened this meant it would always pass,
even if WebKit didn't check for the trusted flag.
So this test has also been updated to fix that.

Tests: 
imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-synthetic-keydown.html
       
imported/w3c/web-platform-tests/html/semantics/popovers/popover-synthetic-keydown.html

* 
LayoutTests/imported/w3c/web-platform-tests/close-watcher/esc-key/synthetic-keyboard-event.html:
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-synthetic-keydown-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-synthetic-keydown.html:
 Copied from 
LayoutTests/imported/w3c/web-platform-tests/close-watcher/esc-key/synthetic-keyboard-event.html.
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-synthetic-keydown-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-synthetic-keydown.html:
 Copied from 
LayoutTests/imported/w3c/web-platform-tests/close-watcher/esc-key/synthetic-keyboard-event.html.
* Source/WebCore/html/closewatcher/CloseWatcherManager.cpp:
(WebCore::CloseWatcherManager::processCloseWatchers):
(WebCore::CloseWatcherManager::escapeKeyHandler): Deleted.
* Source/WebCore/html/closewatcher/CloseWatcherManager.h:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::defaultKeyboardEventHandler):

Canonical link: https://commits.webkit.org/313671@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to