mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibWeb: Implement document.execCommand("delete")
To facilitate the implementation of "delete" and all associated algorithms, split off this piece of `Document` into a separate directory. This sets up the infrastructure for arbitrary commands to be supported.
This commit is contained in:
parent
c87960f8f3
commit
7bb865052a
Notes:
github-actions[bot]
2024-11-30 16:37:23 +00:00
Author: https://github.com/gmta
Commit: 7bb865052a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2655
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/yyny
12 changed files with 2227 additions and 48 deletions
26
Libraries/LibWeb/Editing/Commands.h
Normal file
26
Libraries/LibWeb/Editing/Commands.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Editing {
|
||||
|
||||
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<CommandDefinition const&> find_command_definition(FlyString const&);
|
||||
|
||||
// Command implementations
|
||||
bool command_delete_action(DOM::Document&, String const&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue