Struct script::dom::elementinternals::ElementInternals
source · #[repr(C)]pub struct ElementInternals {
reflector_: Reflector,
attached: Cell<bool>,
target_element: Dom<HTMLElement>,
validity_state: MutNullableDom<ValidityState>,
validation_message: DomRefCell<DOMString>,
custom_validity_error_message: DomRefCell<DOMString>,
validation_anchor: MutNullableDom<HTMLElement>,
submission_value: DomRefCell<SubmissionValue>,
state: DomRefCell<SubmissionValue>,
form_owner: MutNullableDom<HTMLFormElement>,
labels_node_list: MutNullableDom<NodeList>,
}
Fields§
§reflector_: Reflector
§attached: Cell<bool>
If attached
is false, we’re using this to hold form-related state
on an element for which attachInternals()
wasn’t called yet; this is
necessary because it might have a form owner.
target_element: Dom<HTMLElement>
§validity_state: MutNullableDom<ValidityState>
§validation_message: DomRefCell<DOMString>
§custom_validity_error_message: DomRefCell<DOMString>
§validation_anchor: MutNullableDom<HTMLElement>
§submission_value: DomRefCell<SubmissionValue>
§state: DomRefCell<SubmissionValue>
§form_owner: MutNullableDom<HTMLFormElement>
§labels_node_list: MutNullableDom<NodeList>
Implementations§
source§impl ElementInternals
impl ElementInternals
fn __assert_parent_type(&self)
source§impl ElementInternals
impl ElementInternals
fn new_inherited(target_element: &HTMLElement) -> ElementInternals
pub fn new(element: &HTMLElement) -> Root<Dom<ElementInternals>>
fn is_target_form_associated(&self) -> bool
fn set_validation_message(&self, message: DOMString)
fn set_custom_validity_error_message(&self, message: DOMString)
fn set_submission_value(&self, value: SubmissionValue)
fn set_state(&self, value: SubmissionValue)
pub fn set_form_owner(&self, form: Option<&HTMLFormElement>)
pub fn form_owner(&self) -> Option<Root<Dom<HTMLFormElement>>>
pub fn set_attached(&self)
pub fn attached(&self) -> bool
pub fn perform_entry_construction(&self, entry_list: &mut Vec<FormDatum>)
pub fn is_invalid(&self) -> bool
Trait Implementations§
source§impl DomObject for ElementInternals
impl DomObject for ElementInternals
source§impl DomObjectWrap for ElementInternals
impl DomObjectWrap for ElementInternals
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ElementInternalsBinding::ElementInternals_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::elementinternals::ElementInternals>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::elementinternals::ElementInternals>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ElementInternalsBinding::ElementInternals_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::elementinternals::ElementInternals>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::elementinternals::ElementInternals>>}
Function pointer to the general wrap function type
source§impl ElementInternalsMethods for ElementInternals
impl ElementInternalsMethods for ElementInternals
source§fn SetFormValue(
&self,
value: Option<FileOrUSVStringOrFormData>,
maybe_state: Option<Option<FileOrUSVStringOrFormData>>
) -> Result<(), Error>
fn SetFormValue( &self, value: Option<FileOrUSVStringOrFormData>, maybe_state: Option<Option<FileOrUSVStringOrFormData>> ) -> Result<(), Error>
source§fn SetValidity(
&self,
flags: &ValidityStateFlags,
message: Option<DOMString>,
anchor: Option<&HTMLElement>
) -> Result<(), Error>
fn SetValidity( &self, flags: &ValidityStateFlags, message: Option<DOMString>, anchor: Option<&HTMLElement> ) -> Result<(), Error>
source§fn GetValidity(&self) -> Result<Root<Dom<ValidityState>>, Error>
fn GetValidity(&self) -> Result<Root<Dom<ValidityState>>, Error>
source§impl HasParent for ElementInternals
impl HasParent for ElementInternals
source§impl IDLInterface for ElementInternals
impl IDLInterface for ElementInternals
source§impl MallocSizeOf for ElementInternals
impl MallocSizeOf for ElementInternals
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 ElementInternals
impl MutDomObject for ElementInternals
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<ElementInternals> for ElementInternals
impl PartialEq<ElementInternals> for ElementInternals
source§fn eq(&self, other: &ElementInternals) -> bool
fn eq(&self, other: &ElementInternals) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Traceable for ElementInternals
impl Traceable for ElementInternals
source§impl Validatable for ElementInternals
impl Validatable for ElementInternals
source§fn is_instance_validatable(&self) -> bool
fn is_instance_validatable(&self) -> bool
fn as_element(&self) -> &Element
source§fn validity_state(&self) -> Root<Dom<ValidityState>>
fn validity_state(&self) -> Root<Dom<ValidityState>>
fn perform_validation( &self, _validate_flags: ValidationFlags ) -> ValidationFlags
source§fn satisfies_constraints(&self) -> bool
fn satisfies_constraints(&self) -> bool
source§fn report_validity(&self) -> bool
fn report_validity(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for ElementInternals
impl !Send for ElementInternals
impl !Sync for ElementInternals
impl Unpin for ElementInternals
impl !UnwindSafe for ElementInternals
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<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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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