Skip to main content

CustomElementRegistryMethods

pub trait CustomElementRegistryMethods<D: DomTypes> {
    // Required methods
    fn Define(
        &self,
        cx: &mut JSContext,
        name: DOMString,
        constructor_: Rc<CustomElementConstructor<D>>,
        options: &ElementDefinitionOptions,
    ) -> Fallible<()>;
    fn Get(
        &self,
        cx: &mut JSContext,
        name: DOMString,
        rval: MutableHandle<'_, Value>,
    );
    fn GetName(
        &self,
        constructor: Rc<CustomElementConstructor<D>>,
    ) -> Option<DOMString>;
    fn WhenDefined(
        &self,
        realm: &mut CurrentRealm<'_>,
        name: DOMString,
    ) -> Rc<D::Promise>;
    fn Upgrade(&self, cx: &NoGC, root: &D::Node);
    fn Initialize(&self, root: &D::Node) -> Fallible<()>;
    fn Constructor(
        cx: &mut JSContext,
        global: &D::Window,
        proto: Option<HandleObject<'_>>,
    ) -> DomRoot<D::CustomElementRegistry>;
}

Required Methods§

Source

fn Define( &self, cx: &mut JSContext, name: DOMString, constructor_: Rc<CustomElementConstructor<D>>, options: &ElementDefinitionOptions, ) -> Fallible<()>

Source

fn Get( &self, cx: &mut JSContext, name: DOMString, rval: MutableHandle<'_, Value>, )

Source

fn GetName( &self, constructor: Rc<CustomElementConstructor<D>>, ) -> Option<DOMString>

Source

fn WhenDefined( &self, realm: &mut CurrentRealm<'_>, name: DOMString, ) -> Rc<D::Promise>

Source

fn Upgrade(&self, cx: &NoGC, root: &D::Node)

Source

fn Initialize(&self, root: &D::Node) -> Fallible<()>

Source

fn Constructor( cx: &mut JSContext, global: &D::Window, proto: Option<HandleObject<'_>>, ) -> DomRoot<D::CustomElementRegistry>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§