WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
238505
Default event target for keyboard events is different in HTML and XHTML documents
https://bugs.webkit.org/show_bug.cgi?id=238505
Summary
Default event target for keyboard events is different in HTML and XHTML docum...
Robert Knight
Reported
2022-03-29 08:20:34 PDT
Created
attachment 456025
[details]
HTML test case When no element is focused in a document, the element to which keyboard events are dispatched is different in XHTML vs HTML documents. Steps to reproduce: 1. Open attached test.html 2. Focus the document, press some keys and note the `target` property of events logged in the browser console 3. Repeat steps 1 and 2 with attached test.xhtml Ideally the keyboard events would be fired at the same element in both HTML and XHTML documents. In Safari and Chrome the keyboard events are fired at the body element for HTML documents and the document element for XHTML documents. In Firefox the keyboard events are fired at the document body for both document types. For XHTML documents that do not have a body element, Firefox fires events at the document element instead, which seems like reasonable fallback behavior. We encountered this issue when investigating a bug in our web app where a keyboard shortcut handler, installed on the document body, didn't work when the code was loaded in an XHTML document.
Attachments
HTML test case
(117 bytes, text/html)
2022-03-29 08:20 PDT
,
Robert Knight
no flags
Details
XHTML test case
(193 bytes, application/xhtml+xml)
2022-03-29 08:20 PDT
,
Robert Knight
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Robert Knight
Comment 1
2022-03-29 08:20:51 PDT
Created
attachment 456026
[details]
XHTML test case
Robert Knight
Comment 2
2022-03-29 08:21:31 PDT
Related Chrome issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=1311257#c1
Radar WebKit Bug Importer
Comment 3
2022-04-05 08:21:18 PDT
<
rdar://problem/91294819
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug