#[repr(C)]pub(crate) struct HTMLCollection {
reflector_: Reflector,
root: Dom<Node>,
filter: Box<dyn CollectionFilter + 'static>,
cached_version: Cell<u64>,
cached_cursor_element: MutNullableDom<Element>,
cached_cursor_index: Cell<OptionU32>,
cached_length: Cell<OptionU32>,
}
Fields§
§reflector_: Reflector
§root: Dom<Node>
§filter: Box<dyn CollectionFilter + 'static>
§cached_version: Cell<u64>
§cached_cursor_element: MutNullableDom<Element>
§cached_cursor_index: Cell<OptionU32>
§cached_length: Cell<OptionU32>
Implementations§
source§impl HTMLCollection
impl HTMLCollection
pub(crate) fn type_id(&self) -> &'static HTMLCollectionTypeId
source§impl HTMLCollection
impl HTMLCollection
pub(crate) fn new_inherited( root: &Node, filter: Box<dyn CollectionFilter + 'static>, ) -> HTMLCollection
sourcepub(crate) fn always_empty(window: &Window, root: &Node) -> Root<Dom<Self>>
pub(crate) fn always_empty(window: &Window, root: &Node) -> Root<Dom<Self>>
Returns a collection which is always empty.
pub(crate) fn new( window: &Window, root: &Node, filter: Box<dyn CollectionFilter + 'static>, ) -> Root<Dom<Self>>
sourcepub(crate) fn new_with_filter_fn(
window: &Window,
root: &Node,
filter_function: fn(_: &Element, _: &Node) -> bool,
) -> Root<Dom<Self>>
pub(crate) fn new_with_filter_fn( window: &Window, root: &Node, filter_function: fn(_: &Element, _: &Node) -> bool, ) -> Root<Dom<Self>>
Create a new HTMLCollection
that just filters element using a static function.
pub(crate) fn create( window: &Window, root: &Node, filter: Box<dyn CollectionFilter + 'static>, ) -> Root<Dom<Self>>
fn validate_cache(&self)
fn set_cached_cursor( &self, index: u32, element: Option<Root<Dom<Element>>>, ) -> Option<Root<Dom<Element>>>
sourcepub(crate) fn by_qualified_name(
window: &Window,
root: &Node,
qualified_name: LocalName,
) -> Root<Dom<HTMLCollection>>
pub(crate) fn by_qualified_name( window: &Window, root: &Node, qualified_name: LocalName, ) -> Root<Dom<HTMLCollection>>
fn match_element(elem: &Element, qualified_name: &LocalName) -> bool
pub(crate) fn by_tag_name_ns( window: &Window, root: &Node, tag: DOMString, maybe_ns: Option<DOMString>, ) -> Root<Dom<HTMLCollection>>
pub(crate) fn by_qual_tag_name( window: &Window, root: &Node, qname: QualName, ) -> Root<Dom<HTMLCollection>>
pub(crate) fn by_class_name( window: &Window, root: &Node, classes: DOMString, ) -> Root<Dom<HTMLCollection>>
pub(crate) fn by_atomic_class_name( window: &Window, root: &Node, classes: Vec<Atom>, ) -> Root<Dom<HTMLCollection>>
pub(crate) fn children( window: &Window, root: &Node, ) -> Root<Dom<HTMLCollection>>
pub(crate) fn elements_iter_after<'a>( &'a self, after: &'a Node, ) -> impl Iterator<Item = Root<Dom<Element>>> + 'a
pub(crate) fn elements_iter( &self, ) -> impl Iterator<Item = Root<Dom<Element>>> + '_
pub(crate) fn elements_iter_before<'a>( &'a self, before: &'a Node, ) -> impl Iterator<Item = Root<Dom<Element>>> + 'a
pub(crate) fn root_node(&self) -> Root<Dom<Node>>
Trait Implementations§
source§impl Castable for HTMLCollection
impl Castable for HTMLCollection
source§impl DomObject for HTMLCollection
impl DomObject for HTMLCollection
source§fn global(&self) -> Root<Dom<GlobalScope>>where
Self: Sized,
fn global(&self) -> Root<Dom<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
Node
s it’s almost always better to use NodeTraits::owning_global
.source§impl DomObjectWrap for HTMLCollection
impl DomObjectWrap for HTMLCollection
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollection_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::htmlcollection::HTMLCollection>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlcollection::HTMLCollection>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollection_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::htmlcollection::HTMLCollection>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlcollection::HTMLCollection>>}
Function pointer to the general wrap function type
source§impl HTMLCollectionMethods<DomTypeHolder> for HTMLCollection
impl HTMLCollectionMethods<DomTypeHolder> for HTMLCollection
fn IndexedGetter(&self, index: u32) -> Option<Root<Dom<Element>>>
fn NamedGetter(&self, name: DOMString) -> Option<Root<Dom<Element>>>
fn SupportedPropertyNames(&self) -> Vec<DOMString>
source§impl HasParent for HTMLCollection
impl HasParent for HTMLCollection
source§impl IDLInterface for HTMLCollection
impl IDLInterface for HTMLCollection
source§impl MallocSizeOf for HTMLCollection
impl MallocSizeOf for HTMLCollection
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 HTMLCollection
impl MutDomObject for HTMLCollection
source§impl PartialEq for HTMLCollection
impl PartialEq for HTMLCollection
source§impl ToJSValConvertible for HTMLCollection
impl ToJSValConvertible for HTMLCollection
source§impl Traceable for HTMLCollection
impl Traceable for HTMLCollection
impl DerivedFrom<HTMLCollection> for HTMLCollection
impl DerivedFrom<HTMLCollection> for HTMLFormControlsCollection
impl DerivedFrom<HTMLCollection> for HTMLOptionsCollection
impl Eq for HTMLCollection
Auto Trait Implementations§
impl !Freeze for HTMLCollection
impl !RefUnwindSafe for HTMLCollection
impl !Send for HTMLCollection
impl !Sync for HTMLCollection
impl Unpin for HTMLCollection
impl !UnwindSafe for HTMLCollection
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