pub(crate) struct IFrameCollection {
iframes: DomRefCell<Vec<IFrame>>,
iframes_in_insertion_order: DomRefCell<Vec<Dom<HTMLIFrameElement>>>,
}Fields§
§iframes: DomRefCell<Vec<IFrame>>The <iframe>s in the collection. These are kept in DOM tree order to ensure that
requestAnimationFrame callbacks respect that order.
iframes_in_insertion_order: DomRefCell<Vec<Dom<HTMLIFrameElement>>>The same <iframe>s in Self::iframes, but stored in insertion order for use
in the WindowProxy subframe getter.
Implementations§
Source§impl IFrameCollection
impl IFrameCollection
pub(crate) fn new() -> Self
pub(crate) fn add(&self, no_gc: &NoGC, iframe_element: &HTMLIFrameElement)
pub(crate) fn remove( &self, no_gc: &NoGC, iframe_element: &HTMLIFrameElement, ) -> Option<ViewportDetails>
Sourcepub(crate) fn at_insertion_index(
&self,
index: usize,
) -> Option<BrowsingContextId>
pub(crate) fn at_insertion_index( &self, index: usize, ) -> Option<BrowsingContextId>
Get the BrowsingContextId of the <iframe> element at the given
position in insertion order, filtering out <iframe>s that do not have
a browsing context.
Sourcepub(crate) fn active_iframe_count(&self) -> usize
pub(crate) fn active_iframe_count(&self) -> usize
Get a count of the iframes in this [IframeCollection] that have active browsing
contexts.
Sourcepub(crate) fn element(
&self,
browsing_context_id: BrowsingContextId,
) -> Option<DomRoot<HTMLIFrameElement>>
pub(crate) fn element( &self, browsing_context_id: BrowsingContextId, ) -> Option<DomRoot<HTMLIFrameElement>>
Get an iframe elment matching the provided browsing context id, if it exists.
Sourcepub(crate) fn viewport_details(
&self,
browsing_context_id: BrowsingContextId,
) -> Option<ViewportDetails>
pub(crate) fn viewport_details( &self, browsing_context_id: BrowsingContextId, ) -> Option<ViewportDetails>
Get the viewport details for the iframe matching the provided browsing context id, if it exists.
Sourcefn set_viewport_details(
&self,
no_gc: &NoGC,
browsing_context_id: BrowsingContextId,
new_size: ViewportDetails,
) -> Option<ViewportDetails>
fn set_viewport_details( &self, no_gc: &NoGC, browsing_context_id: BrowsingContextId, new_size: ViewportDetails, ) -> Option<ViewportDetails>
Set the size of an <iframe> in the collection given its BrowsingContextId and
the new size. Returns the old size.
Sourcepub(crate) fn handle_new_iframe_sizes_after_layout(
&self,
cx: &mut JSContext,
window: &Window,
new_iframe_sizes: IFrameSizes,
)
pub(crate) fn handle_new_iframe_sizes_after_layout( &self, cx: &mut JSContext, window: &Window, new_iframe_sizes: IFrameSizes, )
Update the recorded iframe sizes of the contents of layout. Return a
Vec<IFrameSizeMsg> containing the messages to send to the Constellation. A
message is only sent when the size actually changes.
pub(crate) fn iter( &self, ) -> impl Iterator<Item = DomRoot<HTMLIFrameElement>> + use<'_>
Trait Implementations§
Source§impl Default for IFrameCollection
impl Default for IFrameCollection
Source§fn default() -> IFrameCollection
fn default() -> IFrameCollection
Source§impl MallocSizeOf for IFrameCollection
impl MallocSizeOf for IFrameCollection
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl !Freeze for IFrameCollection
impl !RefUnwindSafe for IFrameCollection
impl !Send for IFrameCollection
impl !Sync for IFrameCollection
impl Unpin for IFrameCollection
impl UnsafeUnpin for IFrameCollection
impl !UnwindSafe for IFrameCollection
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