LibWeb: Fire input events in .execCommand()

We do not fire `beforeinput` events since other browsers do not seem to
do so either.

The spec asks us to check whether a command's action modified the DOM
tree. This means adding or removing nodes and attributes, or changing
character data anywhere in the tree. We have
`Document::dom_tree_version()` for node updates, but for character data
a new version number is introduced that allows us to easily keep track
of any text changes in the entire tree.
This commit is contained in:
Jelle Raaijmakers 2025-01-23 10:50:00 +01:00 committed by Andreas Kling
commit 0bb0061915
Notes: github-actions[bot] 2025-01-24 22:54:17 +00:00
8 changed files with 104 additions and 41 deletions

View file

@ -24,6 +24,9 @@ struct CommandDefinition {
// https://w3c.github.io/editing/docs/execCommand/#inline-command-activated-values
Vector<StringView> inline_activated_values {};
// https://w3c.github.io/editing/docs/execCommand/#dfn-map-an-edit-command-to-input-type-value
FlyString mapped_value {};
};
Optional<CommandDefinition const&> find_command_definition(FlyString const&);