script/dom/execcommand/commands/
underline.rs1use js::context::JSContext;
6
7use crate::dom::document::Document;
8use crate::dom::execcommand::basecommand::CommandName;
9use crate::dom::execcommand::execcommands::DocumentExecCommandSupport;
10use crate::dom::selection::Selection;
11
12pub(crate) fn execute_underline_command(
14 cx: &mut JSContext,
15 document: &Document,
16 selection: &Selection,
17) -> bool {
18 let value = Some("underline".into())
21 .filter(|_| !document.command_state_for_command(cx, "underline".into()));
22 selection.set_the_selection_value(cx, value, CommandName::Underline, document);
23
24 true
25}