#[repr(C)]pub(crate) struct ValidityState {
reflector_: Reflector,
element: Dom<Element>,
custom_error_message: DomRefCell<DOMString>,
invalid_flags: Cell<ValidationFlags>,
}Fields§
§reflector_: Reflector§element: Dom<Element>§custom_error_message: DomRefCell<DOMString>§invalid_flags: Cell<ValidationFlags>Implementations§
Source§impl ValidityState
impl ValidityState
fn __assert_parent_type(&self)
Source§impl ValidityState
impl ValidityState
fn new_inherited(element: &Element) -> ValidityState
pub(crate) fn new( window: &Window, element: &Element, can_gc: CanGc, ) -> DomRoot<ValidityState>
pub(crate) fn custom_error_message(&self) -> Ref<'_, DOMString>
pub(crate) fn set_custom_error_message(&self, error: DOMString)
Sourcepub(crate) fn perform_validation_and_update(
&self,
update_flags: ValidationFlags,
can_gc: CanGc,
)
pub(crate) fn perform_validation_and_update( &self, update_flags: ValidationFlags, can_gc: CanGc, )
Given a set of ValidationFlags, recalculate their value by performing
validation on this ValidityState’s associated element. Additionally,
if ValidationFlags::CUSTOM_ERROR is in update_flags and a custom
error has been set on this ValidityState, the state will be updated
to reflect the existance of a custom error.
pub(crate) fn update_invalid_flags(&self, update_flags: ValidationFlags)
pub(crate) fn invalid_flags(&self) -> ValidationFlags
pub(crate) fn update_pseudo_classes(&self, can_gc: CanGc)
Trait Implementations§
Source§impl DomObject for ValidityState
impl DomObject for ValidityState
Source§impl DomObjectWrap<DomTypeHolder> for ValidityState
impl DomObjectWrap<DomTypeHolder> for ValidityState
Source§const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::ValidityStateBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::validitystate::ValidityState>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::validitystate::ValidityState>>}
const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::ValidityStateBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::validitystate::ValidityState>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::validitystate::ValidityState>>}
Function pointer to the general wrap function type
Source§impl HasParent for ValidityState
impl HasParent for ValidityState
Source§impl IDLInterface for ValidityState
impl IDLInterface for ValidityState
Source§impl MallocSizeOf for ValidityState
impl MallocSizeOf for ValidityState
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl MutDomObject for ValidityState
impl MutDomObject for ValidityState
Source§impl PartialEq for ValidityState
impl PartialEq for ValidityState
Source§impl ToJSValConvertible for ValidityState
impl ToJSValConvertible for ValidityState
Source§impl Traceable for ValidityState
impl Traceable for ValidityState
Source§impl ValidityStateMethods<DomTypeHolder> for ValidityState
impl ValidityStateMethods<DomTypeHolder> for ValidityState
Source§fn ValueMissing(&self) -> bool
fn ValueMissing(&self) -> bool
Source§fn TypeMismatch(&self) -> bool
fn TypeMismatch(&self) -> bool
Source§fn PatternMismatch(&self) -> bool
fn PatternMismatch(&self) -> bool
Source§fn RangeUnderflow(&self) -> bool
fn RangeUnderflow(&self) -> bool
Source§fn RangeOverflow(&self) -> bool
fn RangeOverflow(&self) -> bool
Source§fn StepMismatch(&self) -> bool
fn StepMismatch(&self) -> bool
Source§fn CustomError(&self) -> bool
fn CustomError(&self) -> bool
impl Eq for ValidityState
Auto Trait Implementations§
impl !Freeze for ValidityState
impl !RefUnwindSafe for ValidityState
impl !Send for ValidityState
impl !Sync for ValidityState
impl Unpin for ValidityState
impl !UnwindSafe for ValidityState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert