LibWeb: Implement the "record current states and values" Editing algo

This commit is contained in:
Jelle Raaijmakers 2024-12-18 12:45:02 +01:00 committed by Jelle Raaijmakers
commit c90c5aad29
Notes: github-actions[bot] 2024-12-21 18:17:34 +00:00
3 changed files with 258 additions and 16 deletions

View file

@ -10,12 +10,17 @@
namespace Web::Editing {
// https://w3c.github.io/editing/docs/execCommand/#properties-of-commands
struct CommandDefinition {
FlyString const& command;
Function<bool(DOM::Document&, String const&)> action {};
Function<bool(DOM::Document const&)> indeterminate {};
Function<bool(DOM::Document const&)> state {};
Function<String(DOM::Document const&)> value {};
Optional<CSS::PropertyID> relevant_css_property {};
// https://w3c.github.io/editing/docs/execCommand/#inline-command-activated-values
Vector<String> inline_activated_values {};
};
Optional<CommandDefinition const&> find_command_definition(FlyString const&);