Files
servo/components/script/dom/execcommand/basecommand.rs
Tim van der Lippe 5853926db0 script: Move contenteditable implementation to dedicated file (#42749)
In preparation of introducing traits for some of these methods,
let's separate them from the basecommand trait. They are not
related to each other and it was making reasoning about where
lives what more difficult.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-24 09:00:43 +00:00

27 lines
857 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::str::DOMString;
use crate::dom::selection::Selection;
pub(crate) trait BaseCommand {
/// <https://w3c.github.io/editing/docs/execCommand/#indeterminate>
fn is_indeterminate(&self) -> bool {
false
}
/// <https://w3c.github.io/editing/docs/execCommand/#state>
fn current_state(&self) -> Option<bool> {
None
}
/// <https://w3c.github.io/editing/docs/execCommand/#value>
fn current_value(&self) -> Option<DOMString> {
None
}
/// <https://w3c.github.io/editing/docs/execCommand/#action>
fn execute(&self, selection: &Selection, value: DOMString) -> bool;
}