Struct script::document_collection::DocumentCollection
source · pub(crate) struct DocumentCollection {
map: HashMapTracedValues<PipelineId, Dom<Document>>,
}
Expand description
The collection of all Document
s managed by the [crate::script_thread::SriptThread
].
This is stored as a mapping of PipelineId
to Document
, but for updating the
rendering, Document
s should be processed in order via Self::documents_in_order
.
Fields§
§map: HashMapTracedValues<PipelineId, Dom<Document>>
Implementations§
source§impl DocumentCollection
impl DocumentCollection
pub fn insert(&mut self, pipeline_id: PipelineId, doc: &Document)
pub fn remove(&mut self, pipeline_id: PipelineId) -> Option<Root<Dom<Document>>>
pub fn find_document( &self, pipeline_id: PipelineId, ) -> Option<Root<Dom<Document>>>
pub fn find_window(&self, pipeline_id: PipelineId) -> Option<Root<Dom<Window>>>
pub fn find_global( &self, pipeline_id: PipelineId, ) -> Option<Root<Dom<GlobalScope>>>
pub fn find_iframe( &self, pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<Root<Dom<HTMLIFrameElement>>>
pub fn iter(&self) -> DocumentsIter<'_> ⓘ
sourcepub(crate) fn documents_in_order(&self) -> Vec<PipelineId>
pub(crate) fn documents_in_order(&self) -> Vec<PipelineId>
Return the documents managed by this crate::script_thread::ScriptThread
in the
order specified by the update the rendering step of the
HTML specification:
Let docs be all fully active Document objects whose relevant agent’s event loop is eventLoop, sorted arbitrarily except that the following conditions must be met:
Any Document B whose container document is A must be listed after A in the list.
If there are two documents A and B that both have the same non-null container document C, then the order of A and B in the list must match the shadow-including tree order of their respective navigable containers in C’s node tree.
In the steps below that iterate over docs, each Document must be processed in the order it is found in the list.
Trait Implementations§
source§impl Default for DocumentCollection
impl Default for DocumentCollection
Auto Trait Implementations§
impl Freeze for DocumentCollection
impl !RefUnwindSafe for DocumentCollection
impl !Send for DocumentCollection
impl !Sync for DocumentCollection
impl Unpin for DocumentCollection
impl !UnwindSafe for DocumentCollection
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
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>
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>
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>
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>
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.