pub(crate) struct DocumentCollection {
map: HashMapTracedValues<PipelineId, Dom<Document>, FxBuildHasher>,
}Expand description
The collection of all Documents managed by the crate::script_thread::ScriptThread.
This is stored as a mapping of PipelineId to Document, but for updating the
rendering, Documents should be processed in order via Self::documents_in_order.
Fields§
§map: HashMapTracedValues<PipelineId, Dom<Document>, FxBuildHasher>Implementations§
Source§impl DocumentCollection
impl DocumentCollection
pub(crate) fn insert(&mut self, pipeline_id: PipelineId, doc: &Document)
pub(crate) fn remove( &mut self, pipeline_id: PipelineId, ) -> Option<DomRoot<Document>>
pub(crate) fn find_document( &self, pipeline_id: PipelineId, ) -> Option<DomRoot<Document>>
pub(crate) fn find_window( &self, pipeline_id: PipelineId, ) -> Option<DomRoot<Window>>
pub(crate) fn find_global( &self, pipeline_id: PipelineId, ) -> Option<DomRoot<GlobalScope>>
pub(crate) fn find_iframe( &self, pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<DomRoot<HTMLIFrameElement>>
pub(crate) 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 more