LibWeb: Fix always-enabled copy command in queryCommandEnabled()

The "copy" command is not in the Miscellaneous commands section. The
"defaultParagraphSeparator" command is, however. Let the accompanying
comment reflect that.
This commit is contained in:
Jelle Raaijmakers 2024-12-02 00:40:32 +01:00 committed by Andreas Kling
parent 3f1523b16c
commit c9a6bac57f
Notes: github-actions[bot] 2024-12-02 23:21:02 +00:00

View file

@ -96,12 +96,10 @@ bool Document::query_command_enabled(FlyString const& command)
return false;
// https://w3c.github.io/editing/docs/execCommand/#enabled
// Among commands defined in this specification, those listed in Miscellaneous commands are
// always enabled, except for the cut command and the paste command.
// AD-HOC: Cut and Paste are not in the Miscellaneous commands section; so Copy is assumed
// AD-HOC: DefaultParagraphSeparator is also in the Miscellaneous commands section
// Among commands defined in this specification, those listed in Miscellaneous commands are always enabled, except
// for the cut command and the paste command.
// NOTE: cut and paste are actually in the Clipboard commands section
if (command.is_one_of(
Editing::CommandNames::copy,
Editing::CommandNames::defaultParagraphSeparator,
Editing::CommandNames::redo,
Editing::CommandNames::selectAll,