Struct script::dom::customelementregistry::CustomElementRegistry
source · #[repr(C)]pub struct CustomElementRegistry {
reflector_: Reflector,
window: Dom<Window>,
when_defined: DomRefCell<HashMapTracedValues<LocalName, Rc<Promise>>>,
element_definition_is_running: Cell<bool>,
definitions: DomRefCell<HashMapTracedValues<LocalName, Rc<CustomElementDefinition>>>,
}
Expand description
Fields§
§reflector_: Reflector
§window: Dom<Window>
§when_defined: DomRefCell<HashMapTracedValues<LocalName, Rc<Promise>>>
§element_definition_is_running: Cell<bool>
§definitions: DomRefCell<HashMapTracedValues<LocalName, Rc<CustomElementDefinition>>>
Implementations§
source§impl CustomElementRegistry
impl CustomElementRegistry
fn __assert_parent_type(&self)
source§impl CustomElementRegistry
impl CustomElementRegistry
fn new_inherited(window: &Window) -> CustomElementRegistry
pub fn new(window: &Window) -> Root<Dom<CustomElementRegistry>>
sourcepub fn teardown(&self)
pub fn teardown(&self)
Cleans up any active promises https://github.com/servo/servo/issues/15318
sourcepub fn lookup_definition(
&self,
local_name: &LocalName,
is: Option<&LocalName>,
) -> Option<Rc<CustomElementDefinition>>
pub fn lookup_definition( &self, local_name: &LocalName, is: Option<&LocalName>, ) -> Option<Rc<CustomElementDefinition>>
pub fn lookup_definition_by_constructor( &self, constructor: HandleObject<'_>, ) -> Option<Rc<CustomElementDefinition>>
sourcefn check_prototype(
&self,
constructor: HandleObject<'_>,
prototype: MutableHandleValue<'_>,
) -> Result<(), Error>
fn check_prototype( &self, constructor: HandleObject<'_>, prototype: MutableHandleValue<'_>, ) -> Result<(), Error>
sourceunsafe fn get_callbacks(
&self,
prototype: HandleObject<'_>,
) -> Result<LifecycleCallbacks, Error>
unsafe fn get_callbacks( &self, prototype: HandleObject<'_>, ) -> Result<LifecycleCallbacks, Error>
https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define This function includes both steps 14.3 and 14.4 which add the callbacks to a map and process them.
sourceunsafe fn add_form_associated_callbacks(
&self,
prototype: HandleObject<'_>,
callbacks: &mut LifecycleCallbacks,
) -> Result<(), Error>
unsafe fn add_form_associated_callbacks( &self, prototype: HandleObject<'_>, callbacks: &mut LifecycleCallbacks, ) -> Result<(), Error>
https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define Step 14.13: Add form associated callbacks to LifecycleCallbacks
fn get_observed_attributes( &self, constructor: HandleObject<'_>, ) -> Result<Vec<DOMString>, Error>
sourcefn get_form_associated_value(
&self,
constructor: HandleObject<'_>,
) -> Result<bool, Error>
fn get_form_associated_value( &self, constructor: HandleObject<'_>, ) -> Result<bool, Error>
https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define
Step 14.11: Get the value of formAssociated
.
sourcefn get_disabled_features(
&self,
constructor: HandleObject<'_>,
) -> Result<Vec<DOMString>, Error>
fn get_disabled_features( &self, constructor: HandleObject<'_>, ) -> Result<Vec<DOMString>, Error>
https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define
Step 14.7: Get disabledFeatures
value
Trait Implementations§
source§impl CustomElementRegistryMethods for CustomElementRegistry
impl CustomElementRegistryMethods for CustomElementRegistry
source§fn Define(
&self,
name: DOMString,
constructor_: Rc<CustomElementConstructor>,
options: &ElementDefinitionOptions,
) -> Result<(), Error>
fn Define( &self, name: DOMString, constructor_: Rc<CustomElementConstructor>, options: &ElementDefinitionOptions, ) -> Result<(), Error>
source§impl DomObject for CustomElementRegistry
impl DomObject for CustomElementRegistry
source§impl DomObjectWrap for CustomElementRegistry
impl DomObjectWrap for CustomElementRegistry
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistry_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::customelementregistry::CustomElementRegistry>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::customelementregistry::CustomElementRegistry>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistry_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::customelementregistry::CustomElementRegistry>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::customelementregistry::CustomElementRegistry>>}
Function pointer to the general wrap function type
source§impl HasParent for CustomElementRegistry
impl HasParent for CustomElementRegistry
source§impl IDLInterface for CustomElementRegistry
impl IDLInterface for CustomElementRegistry
source§impl MallocSizeOf for CustomElementRegistry
impl MallocSizeOf for CustomElementRegistry
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 CustomElementRegistry
impl MutDomObject for CustomElementRegistry
source§impl PartialEq for CustomElementRegistry
impl PartialEq for CustomElementRegistry
source§impl Traceable for CustomElementRegistry
impl Traceable for CustomElementRegistry
impl Eq for CustomElementRegistry
Auto Trait Implementations§
impl !Freeze for CustomElementRegistry
impl !RefUnwindSafe for CustomElementRegistry
impl !Send for CustomElementRegistry
impl !Sync for CustomElementRegistry
impl Unpin for CustomElementRegistry
impl !UnwindSafe for CustomElementRegistry
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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