script/dom/execcommand/commands/
fontname.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use js::context::JSContext;
6
7use crate::dom::bindings::str::DOMString;
8use crate::dom::document::Document;
9use crate::dom::execcommand::basecommand::CommandName;
10use crate::dom::selection::Selection;
11
12/// <https://w3c.github.io/editing/docs/execCommand/#the-fontname-command>
13pub(crate) fn execute_fontname_command(
14    cx: &mut JSContext,
15    document: &Document,
16    selection: &Selection,
17    value: DOMString,
18) -> bool {
19    // > Set the selection's value to value, then return true.
20    selection.set_the_selection_value(cx, Some(value), CommandName::FontName, document);
21
22    true
23}