mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 23:59:53 +00:00
LibWeb: Port document.execCommand and InputEvent to UTF-16
This commit is contained in:
parent
49467d0583
commit
2da615ed31
Notes:
github-actions[bot]
2025-07-25 22:41:42 +00:00
Author: https://github.com/trflynn89
Commit: 2da615ed31
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5608
Reviewed-by: https://github.com/gmta ✅
8 changed files with 25 additions and 24 deletions
|
@ -17,7 +17,7 @@
|
|||
namespace Web::DOM {
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#execcommand()
|
||||
WebIDL::ExceptionOr<bool> Document::exec_command(FlyString const& command, [[maybe_unused]] bool show_ui, String const& value)
|
||||
WebIDL::ExceptionOr<bool> Document::exec_command(FlyString const& command, [[maybe_unused]] bool show_ui, Utf16String const& value)
|
||||
{
|
||||
// AD-HOC: This is not directly mentioned in the spec, but all major browsers limit editing API calls to HTML documents
|
||||
if (!is_html_document())
|
||||
|
@ -101,8 +101,7 @@ WebIDL::ExceptionOr<bool> Document::exec_command(FlyString const& command, [[may
|
|||
auto old_character_data_version = character_data_version();
|
||||
|
||||
// 5. Take the action for command, passing value to the instructions as an argument.
|
||||
auto utf16_value = Utf16String::from_utf8_without_validation(value);
|
||||
auto command_result = command_definition.action(*this, utf16_value.utf16_view());
|
||||
auto command_result = command_definition.action(*this, value);
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#preserves-overrides
|
||||
// After taking the action, if the active range is collapsed, it must restore states and values from the recorded
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue