Struct constellation::browsingcontext::BrowsingContext
source · pub struct BrowsingContext {
pub bc_group_id: BrowsingContextGroupId,
pub id: BrowsingContextId,
pub top_level_id: TopLevelBrowsingContextId,
pub size: Size2D<f32, CSSPixel>,
pub is_private: bool,
pub inherited_secure_context: Option<bool>,
pub throttled: bool,
pub pipeline_id: PipelineId,
pub parent_pipeline_id: Option<PipelineId>,
pub pipelines: HashSet<PipelineId>,
}
Expand description
The constellation’s view of a browsing context. Each browsing context has a session history, caused by navigation and traversing the history. Each browsing context has its current entry, plus past and future entries. The past is sorted chronologically, the future is sorted reverse chronologically: in particular prev.pop() is the latest past entry, and next.pop() is the earliest future entry.
Fields§
§bc_group_id: BrowsingContextGroupId
The browsing context group id where the top-level of this bc is found.
id: BrowsingContextId
The browsing context id.
top_level_id: TopLevelBrowsingContextId
The top-level browsing context ancestor
size: Size2D<f32, CSSPixel>
The size of the frame.
is_private: bool
Whether this browsing context is in private browsing mode.
inherited_secure_context: Option<bool>
Whether this browsing context inherits a secure context.
throttled: bool
Whether this browsing context should be throttled, using less resources by stopping animations and running timers at a heavily limited rate.
pipeline_id: PipelineId
The pipeline for the current session history entry.
parent_pipeline_id: Option<PipelineId>
The parent pipeline that contains this browsing context. None
if this
is a top level browsing context.
pipelines: HashSet<PipelineId>
All the pipelines that have been presented or will be presented in this browsing context.
Implementations§
source§impl BrowsingContext
impl BrowsingContext
sourcepub fn new(
bc_group_id: BrowsingContextGroupId,
id: BrowsingContextId,
top_level_id: TopLevelBrowsingContextId,
pipeline_id: PipelineId,
parent_pipeline_id: Option<PipelineId>,
size: Size2D<f32, CSSPixel>,
is_private: bool,
inherited_secure_context: Option<bool>,
throttled: bool,
) -> BrowsingContext
pub fn new( bc_group_id: BrowsingContextGroupId, id: BrowsingContextId, top_level_id: TopLevelBrowsingContextId, pipeline_id: PipelineId, parent_pipeline_id: Option<PipelineId>, size: Size2D<f32, CSSPixel>, is_private: bool, inherited_secure_context: Option<bool>, throttled: bool, ) -> BrowsingContext
Create a new browsing context. Note this just creates the browsing context, it doesn’t add it to the constellation’s set of browsing contexts.
pub fn update_current_entry(&mut self, pipeline_id: PipelineId)
sourcepub fn is_top_level(&self) -> bool
pub fn is_top_level(&self) -> bool
Is this a top-level browsing context?
Auto Trait Implementations§
impl Freeze for BrowsingContext
impl RefUnwindSafe for BrowsingContext
impl Send for BrowsingContext
impl Sync for BrowsingContext
impl Unpin for BrowsingContext
impl UnwindSafe for BrowsingContext
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> 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