mirror of
https://github.com/servo/servo
synced 2026-05-12 01:46:28 +02:00
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>
27 lines
857 B
Rust
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;
|
|
}
|