script/dom/execcommand/
basecommand.rs1use crate::dom::bindings::str::DOMString;
6use crate::dom::document::Document;
7use crate::dom::selection::Selection;
8
9pub(crate) trait BaseCommand {
10 fn is_indeterminate(&self) -> bool {
12 false
13 }
14
15 fn current_state(&self, _document: &Document) -> Option<bool> {
17 None
18 }
19
20 fn current_value(&self, _document: &Document) -> Option<DOMString> {
22 None
23 }
24
25 fn execute(
27 &self,
28 cx: &mut js::context::JSContext,
29 document: &Document,
30 selection: &Selection,
31 value: DOMString,
32 ) -> bool;
33}
34
35#[derive(Default, Clone, Copy, MallocSizeOf)]
36pub(crate) enum DefaultSingleLineContainerName {
37 #[default]
38 Div,
39 Paragraph,
40}