mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 22:56:04 +00:00
LibWeb: Start integrating the editing API with user keyboard input
This reworks EventHandler so text insertion, backspace, delete and return actions are now handled by the Editing API. This was the whole point of the execCommand spec, to provide an implementation of both editing commands and the expected editing behavior on user input. Responsibility of firing the `input` event is moved from EventHandler to the Editing API, which also gets rid of duplicate events whenever dealing with `<input>` or `<textarea>` events. The `beforeinput` event still needs to be fired by `EventHandler` however, since that is never fired by `execCommand()`.
This commit is contained in:
parent
564f5ca2cc
commit
ac46ec0b2e
Notes:
github-actions[bot]
2025-05-16 22:30:34 +00:00
Author: https://github.com/gmta
Commit: ac46ec0b2e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4779
9 changed files with 84 additions and 80 deletions
|
@ -229,6 +229,10 @@ inline KeyCode code_point_to_key_code(u32 code_point)
|
|||
#define MATCH_KEY(name, character) \
|
||||
case character: \
|
||||
return KeyCode::Key_##name;
|
||||
MATCH_KEY(Backspace, '\b')
|
||||
MATCH_KEY(Tab, '\t')
|
||||
MATCH_KEY(Return, '\n')
|
||||
MATCH_KEY(Space, ' ')
|
||||
MATCH_KEY(ExclamationPoint, '!')
|
||||
MATCH_KEY(DoubleQuote, '"')
|
||||
MATCH_KEY(Hashtag, '#')
|
||||
|
@ -271,9 +275,6 @@ inline KeyCode code_point_to_key_code(u32 code_point)
|
|||
MATCH_KEY(Pipe, '|')
|
||||
MATCH_KEY(Tilde, '~')
|
||||
MATCH_KEY(Backtick, '`')
|
||||
MATCH_KEY(Space, ' ')
|
||||
MATCH_KEY(Tab, '\t')
|
||||
MATCH_KEY(Backspace, '\b')
|
||||
#undef MATCH_KEY
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue