mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Implement the "fontName" editing command
This commit is contained in:
parent
1b02e0dea3
commit
9366a50dd3
Notes:
github-actions[bot]
2025-01-10 22:37:01 +00:00
Author: https://github.com/gmta
Commit: 9366a50dd3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
4 changed files with 39 additions and 0 deletions
|
@ -492,6 +492,14 @@ bool command_delete_action(DOM::Document& document, String const&)
|
|||
return true;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#the-fontname-command
|
||||
bool command_font_name_action(DOM::Document& document, String const& value)
|
||||
{
|
||||
// Set the selection's value to value, then return true.
|
||||
set_the_selections_value(document, CommandNames::fontName, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#the-forwarddelete-command
|
||||
bool command_forward_delete_action(DOM::Document& document, String const&)
|
||||
{
|
||||
|
@ -1115,6 +1123,12 @@ static Array const commands {
|
|||
.action = command_default_paragraph_separator_action,
|
||||
.value = command_default_paragraph_separator_value,
|
||||
},
|
||||
// https://w3c.github.io/editing/docs/execCommand/#the-fontname-command
|
||||
CommandDefinition {
|
||||
.command = CommandNames::fontName,
|
||||
.action = command_font_name_action,
|
||||
.relevant_css_property = CSS::PropertyID::FontFamily,
|
||||
},
|
||||
// https://w3c.github.io/editing/docs/execCommand/#the-forwarddelete-command
|
||||
CommandDefinition {
|
||||
.command = CommandNames::forwardDelete,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue