Skip to main content

DocumentConfig

Struct DocumentConfig 

Source
pub struct DocumentConfig {
Show 13 fields pub viewport: Option<Viewport>, pub base_url: Option<String>, pub ua_stylesheets: Vec<UserAgentStylesheet>, pub net_provider: Option<Arc<dyn NetProvider>>, pub navigation_provider: Option<Arc<dyn NavigationProvider>>, pub shell_provider: Option<Arc<dyn ShellProvider>>, pub html_parser_provider: Option<Arc<dyn HtmlParserProvider>>, pub font_ctx: Option<FontContext>, pub media_type: Option<MediaType>, pub style_threading: StyleThreading, pub incremental: Option<bool>, pub abort_signal: Option<AbortSignal>, pub subdocument_depth: usize,
}
Expand description

Options used when constructing a BaseDocument

Fields§

§viewport: Option<Viewport>

The initial Viewport

§base_url: Option<String>

The base url which relative URLs are resolved against

§ua_stylesheets: Vec<UserAgentStylesheet>

User Agent stylesheets, in cascade order. Defaults to vec![UserAgentStylesheet::default_sheet()].

The list is used as given, so replacing it removes the default sheet unless it is included, e.g. vec![UserAgentStylesheet::default_sheet(), custom].

§net_provider: Option<Arc<dyn NetProvider>>

Net provider to handle network requests for resources

§navigation_provider: Option<Arc<dyn NavigationProvider>>

Navigation provider to handle link clicks and form submissions

§shell_provider: Option<Arc<dyn ShellProvider>>

Shell provider to redraw requests, clipboard, etc

§html_parser_provider: Option<Arc<dyn HtmlParserProvider>>

HTML parser provider. Used to parse HTML for setInnerHTML

§font_ctx: Option<FontContext>

Parley FontContext

§media_type: Option<MediaType>

The CSS media type used to evaluate @media rules. Defaults to MediaType::screen.

§style_threading: StyleThreading

Strategy for Stylo’s style traversal. Defaults to StyleThreading::Parallel.

§incremental: Option<bool>

Whether incremental layout is enabled. Defaults to true.

When disabled, every node is treated as damaged on each resolve and the whole tree is reconstructed and laid out from scratch through the same damage-driven pipeline used by incremental mode.

§abort_signal: Option<AbortSignal>

If set, every sub-resource Request apace-dom creates for this document will carry this signal. Aborting it cancels every in-flight fetch tied to this document.

§subdocument_depth: usize

How deeply this document is nested within other documents (0 for a root document). Used to limit <iframe> nesting depth.

Trait Implementations§

Source§

impl Default for DocumentConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.