From c9a6bac57f0c04ae98b97c77f53d80a27c70417f Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 2 Dec 2024 00:40:32 +0100 Subject: [PATCH] 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. --- Libraries/LibWeb/Editing/ExecCommand.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/Editing/ExecCommand.cpp b/Libraries/LibWeb/Editing/ExecCommand.cpp index 1295133ef83..1efa45e4888 100644 --- a/Libraries/LibWeb/Editing/ExecCommand.cpp +++ b/Libraries/LibWeb/Editing/ExecCommand.cpp @@ -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,