Skip to content

Commit 96fbb33

Browse files
committed
LibWeb: Log when document.execCommand and family are called
These are used by WPT. Log the commands so we know what we need to implement.
1 parent b035f0c commit 96fbb33

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

Userland/Libraries/LibWeb/DOM/Document.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,38 +4959,44 @@ JS::Value Document::named_item_value(FlyString const& name) const
49594959
}
49604960

49614961
// https://w3c.github.io/editing/docs/execCommand/#execcommand()
4962-
bool Document::exec_command(String, bool, String)
4962+
bool Document::exec_command(String const& command, bool show_ui, String const& value)
49634963
{
4964+
dbgln("FIXME: document.execCommand(\"{}\", {}, \"{}\")", command, show_ui, value);
49644965
return false;
49654966
}
49664967

49674968
// https://w3c.github.io/editing/docs/execCommand/#querycommandenabled()
4968-
bool Document::query_command_enabled(String)
4969+
bool Document::query_command_enabled(String const& command)
49694970
{
4971+
dbgln("FIXME: document.queryCommandEnabled(\"{}\")", command);
49704972
return false;
49714973
}
49724974

49734975
// https://w3c.github.io/editing/docs/execCommand/#querycommandindeterm()
4974-
bool Document::query_command_indeterm(String)
4976+
bool Document::query_command_indeterm(String const& command)
49754977
{
4978+
dbgln("FIXME: document.queryCommandIndeterm(\"{}\")", command);
49764979
return false;
49774980
}
49784981

49794982
// https://w3c.github.io/editing/docs/execCommand/#querycommandstate()
4980-
bool Document::query_command_state(String)
4983+
bool Document::query_command_state(String const& command)
49814984
{
4985+
dbgln("FIXME: document.queryCommandState(\"{}\")", command);
49824986
return false;
49834987
}
49844988

49854989
// https://w3c.github.io/editing/docs/execCommand/#querycommandsupported()
4986-
bool Document::query_command_supported(String)
4990+
bool Document::query_command_supported(String const& command)
49874991
{
4992+
dbgln("FIXME: document.queryCommandSupported(\"{}\")", command);
49884993
return false;
49894994
}
49904995

49914996
// https://w3c.github.io/editing/docs/execCommand/#querycommandvalue()
4992-
String Document::query_command_value(String)
4997+
String Document::query_command_value(String const& command)
49934998
{
4999+
dbgln("FIXME: document.queryCommandValue(\"{}\")", command);
49945000
return String {};
49955001
}
49965002

Userland/Libraries/LibWeb/DOM/Document.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,12 @@ class Document
561561
void set_previous_document_unload_timing(DocumentUnloadTimingInfo const& previous_document_unload_timing) { m_previous_document_unload_timing = previous_document_unload_timing; }
562562

563563
// https://w3c.github.io/editing/docs/execCommand/
564-
bool exec_command(String command_id, bool show_ui, String value);
565-
bool query_command_enabled(String command_id);
566-
bool query_command_indeterm(String command_id);
567-
bool query_command_state(String command_id);
568-
bool query_command_supported(String command_id);
569-
String query_command_value(String command_id);
564+
bool exec_command(String const& command, bool show_ui, String const& value);
565+
bool query_command_enabled(String const& command);
566+
bool query_command_indeterm(String const& command);
567+
bool query_command_state(String const& command);
568+
bool query_command_supported(String const& command);
569+
String query_command_value(String const& command);
570570

571571
bool is_allowed_to_use_feature(PolicyControlledFeature) const;
572572

0 commit comments

Comments
 (0)