mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 15:17:45 +00:00
LibWeb: Improve Unicode compatibility of HTML contenteditable
This patch updates the Page::keydown_event event handler to implement crude Unicode support. It implements new method in EditEventHandler to more easily handle deleting a single character after the cursor. Furthermore, it makes use of the previously implemented methods to increment and decrement the cursor position, which take into account that Unicode codepoint may be multiple bytes wide. This means it is now possible to mostly edit Unicode in editable DOM nodes without any crashes. :^)
This commit is contained in:
parent
7181cb3a9c
commit
9440a3c280
3 changed files with 32 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, the SerenityOS developers.
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -20,6 +20,7 @@ public:
|
|||
|
||||
virtual ~EditEventHandler() = default;
|
||||
|
||||
virtual void handle_delete_character_after(const DOM::Position&);
|
||||
virtual void handle_delete(DOM::Range&);
|
||||
virtual void handle_insert(DOM::Position, u32 code_point);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue