compositing::webview

Struct WebView

Source
pub(crate) struct WebView {
Show 13 fields pub id: WebViewId, pub renderer_webview: Box<dyn RendererWebView>, pub root_pipeline_id: Option<PipelineId>, pub rect: DeviceRect, pub pipelines: HashMap<PipelineId, PipelineDetails>, pub(crate) global: Rc<RefCell<ServoRenderer>>, pending_scroll_zoom_events: Vec<ScrollZoomEvent>, touch_handler: TouchHandler, pub page_zoom: Scale<f32, CSSPixel, DeviceIndependentPixel>, viewport_zoom: PinchZoomFactor, min_viewport_zoom: Option<PinchZoomFactor>, max_viewport_zoom: Option<PinchZoomFactor>, hidpi_scale_factor: Scale<f32, DeviceIndependentPixel, DevicePixel>,
}

Fields§

§id: WebViewId

The WebViewId of the WebView associated with this [WebViewDetails].

§renderer_webview: Box<dyn RendererWebView>

The renderer’s view of the embedding layer WebView as a trait implementation, so that the renderer doesn’t need to depend on the embedding layer. This avoids a dependency cycle.

§root_pipeline_id: Option<PipelineId>

The root PipelineId of the currently displayed page in this WebView.

§rect: DeviceRect§pipelines: HashMap<PipelineId, PipelineDetails>

Tracks details about each active pipeline that the compositor knows about.

§global: Rc<RefCell<ServoRenderer>>

Data that is shared by all WebView renderers.

§pending_scroll_zoom_events: Vec<ScrollZoomEvent>

Pending scroll/zoom events.

§touch_handler: TouchHandler

Touch input state machine

§page_zoom: Scale<f32, CSSPixel, DeviceIndependentPixel>

“Desktop-style” zoom that resizes the viewport to fit the window.

§viewport_zoom: PinchZoomFactor

“Mobile-style” zoom that does not reflow the page.

§min_viewport_zoom: Option<PinchZoomFactor>

Viewport zoom constraints provided by @viewport.

§max_viewport_zoom: Option<PinchZoomFactor>§hidpi_scale_factor: Scale<f32, DeviceIndependentPixel, DevicePixel>

The HiDPI scale factor for the WebView associated with this renderer. This is controlled by the embedding layer.

Implementations§

Source§

impl WebView

Source

pub(crate) fn new( global: Rc<RefCell<ServoRenderer>>, renderer_webview: Box<dyn RendererWebView>, viewport_details: ViewportDetails, ) -> Self

Source

pub(crate) fn animations_or_animation_callbacks_running(&self) -> bool

Source

pub(crate) fn animation_callbacks_running(&self) -> bool

Source

pub(crate) fn pipeline_ids(&self) -> Keys<'_, PipelineId, PipelineDetails>

Source

pub(crate) fn ensure_pipeline_details( &mut self, pipeline_id: PipelineId, ) -> &mut PipelineDetails

Returns the PipelineDetails for the given PipelineId, creating it if needed.

Source

pub(crate) fn set_throttled(&mut self, pipeline_id: PipelineId, throttled: bool)

Source

pub(crate) fn remove_pipeline(&mut self, pipeline_id: PipelineId)

Source

pub(crate) fn set_frame_tree(&mut self, frame_tree: &SendableFrameTree)

Source

pub(crate) fn send_scroll_positions_to_layout_for_pipeline( &self, pipeline_id: PipelineId, )

Source

pub(crate) fn set_frame_tree_on_pipeline_details( &mut self, frame_tree: &SendableFrameTree, parent_pipeline_id: Option<PipelineId>, )

Source

pub(crate) fn reset_scroll_tree_for_unattached_pipelines( &mut self, frame_tree: &SendableFrameTree, )

Source

pub(crate) fn change_running_animations_state( &mut self, pipeline_id: PipelineId, animation_state: AnimationState, ) -> bool

Sets or unsets the animations-running flag for the given pipeline. Returns true if the pipeline is throttled.

Source

pub(crate) fn tick_all_animations(&self, compositor: &IOCompositor)

Source

pub(crate) fn tick_animations_for_pipeline( &self, pipeline_id: PipelineId, compositor: &IOCompositor, )

Source

pub(crate) fn on_vsync(&mut self)

On a Window refresh tick (e.g. vsync)

Source

pub(crate) fn dispatch_input_event(&mut self, event: InputEvent)

Source

pub(crate) fn notify_input_event(&mut self, event: InputEvent)

Source

fn send_touch_event(&self, event: TouchEvent) -> bool

Source

pub(crate) fn on_touch_event(&mut self, event: TouchEvent)

Source

fn on_touch_down(&mut self, event: TouchEvent)

Source

fn on_touch_move(&mut self, event: TouchEvent)

Source

fn on_touch_up(&mut self, event: TouchEvent)

Source

fn on_touch_cancel(&mut self, event: TouchEvent)

Source

pub(crate) fn on_touch_event_processed(&mut self, result: TouchEventResult)

Source

fn simulate_mouse_click(&mut self, point: DevicePoint)

Source

pub(crate) fn notify_scroll_event( &mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint, event_type: TouchEventType, )

Source

fn on_scroll_window_event( &mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint, )

Source

pub(crate) fn process_pending_scroll_events( &mut self, compositor: &mut IOCompositor, )

Source

fn scroll_node_at_device_point( &mut self, cursor: DevicePoint, scroll_location: ScrollLocation, ) -> Option<(PipelineId, ExternalScrollId, LayoutVector2D)>

Perform a hit test at the given DevicePoint and apply the ScrollLocation scrolling to the applicable scroll node under that point. If a scroll was performed, returns the PipelineId of the node scrolled, the id, and the final scroll delta.

Source

pub(crate) fn pinch_zoom_level(&self) -> Scale<f32, DevicePixel, DevicePixel>

Source

fn set_pinch_zoom_level(&mut self, zoom: f32) -> bool

Source

pub(crate) fn set_page_zoom(&mut self, magnification: f32)

Source

pub(crate) fn device_pixels_per_page_pixel( &self, ) -> Scale<f32, CSSPixel, DevicePixel>

Source

pub(crate) fn device_pixels_per_page_pixel_not_including_pinch_zoom( &self, ) -> Scale<f32, CSSPixel, DevicePixel>

Source

pub(crate) fn set_pinch_zoom(&mut self, magnification: f32)

Simulate a pinch zoom

Source

fn send_window_size_message(&self)

Source

pub(crate) fn set_hidpi_scale_factor( &mut self, new_scale: Scale<f32, DeviceIndependentPixel, DevicePixel>, ) -> bool

Set the hidpi_scale_factor for this renderer, returning true if the value actually changed.

Source

pub(crate) fn set_rect(&mut self, new_rect: DeviceRect) -> bool

Set the rect for this renderer, returning true if the value actually changed.

Source

pub(crate) fn client_window_rect( &self, rendering_context_size: Size2D<u32, DevicePixel>, ) -> Box2D<i32, DeviceIndependentPixel>

Source

pub(crate) fn screen_size(&self) -> Size2D<i32, DeviceIndependentPixel>

Source

pub(crate) fn available_screen_size( &self, ) -> Size2D<i32, DeviceIndependentPixel>

Trait Implementations§

Source§

impl Drop for WebView

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for WebView

§

impl !RefUnwindSafe for WebView

§

impl !Send for WebView

§

impl !Sync for WebView

§

impl Unpin for WebView

§

impl !UnwindSafe for WebView

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> MaybeSendSync for T