script/dom/execcommand/commands/
strikethrough.rs1use js::context::JSContext;
6use script_bindings::str::DOMString;
7
8use crate::dom::document::Document;
9use crate::dom::execcommand::basecommand::CommandName;
10use crate::dom::execcommand::execcommands::DocumentExecCommandSupport;
11use crate::dom::selection::Selection;
12
13pub(crate) fn execute_strikethrough_command(
15 cx: &mut JSContext,
16 document: &Document,
17 selection: &Selection,
18) -> bool {
19 let value = (!document.command_state_for_command(cx, DOMString::from_static("strikethrough")))
22 .then_some(DOMString::from_static("line-through"));
23 selection.set_the_selection_value(cx, value, CommandName::Strikethrough, document);
24
25 true
26}