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
impl WebView
pub(crate) fn new( global: Rc<RefCell<ServoRenderer>>, renderer_webview: Box<dyn RendererWebView>, viewport_details: ViewportDetails, ) -> Self
pub(crate) fn animations_or_animation_callbacks_running(&self) -> bool
pub(crate) fn animation_callbacks_running(&self) -> bool
pub(crate) fn pipeline_ids(&self) -> Keys<'_, PipelineId, PipelineDetails>
Sourcepub(crate) fn ensure_pipeline_details(
&mut self,
pipeline_id: PipelineId,
) -> &mut PipelineDetails
pub(crate) fn ensure_pipeline_details( &mut self, pipeline_id: PipelineId, ) -> &mut PipelineDetails
Returns the PipelineDetails
for the given PipelineId
, creating it if needed.
pub(crate) fn set_throttled(&mut self, pipeline_id: PipelineId, throttled: bool)
pub(crate) fn remove_pipeline(&mut self, pipeline_id: PipelineId)
pub(crate) fn set_frame_tree(&mut self, frame_tree: &SendableFrameTree)
pub(crate) fn send_scroll_positions_to_layout_for_pipeline( &self, pipeline_id: PipelineId, )
pub(crate) fn set_frame_tree_on_pipeline_details( &mut self, frame_tree: &SendableFrameTree, parent_pipeline_id: Option<PipelineId>, )
pub(crate) fn reset_scroll_tree_for_unattached_pipelines( &mut self, frame_tree: &SendableFrameTree, )
Sourcepub(crate) fn change_running_animations_state(
&mut self,
pipeline_id: PipelineId,
animation_state: AnimationState,
) -> bool
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.
pub(crate) fn tick_all_animations(&self, compositor: &IOCompositor)
pub(crate) fn tick_animations_for_pipeline( &self, pipeline_id: PipelineId, compositor: &IOCompositor, )
pub(crate) fn dispatch_input_event(&mut self, event: InputEvent)
pub(crate) fn notify_input_event(&mut self, event: InputEvent)
fn send_touch_event(&self, event: TouchEvent) -> bool
pub(crate) fn on_touch_event(&mut self, event: TouchEvent)
fn on_touch_down(&mut self, event: TouchEvent)
fn on_touch_move(&mut self, event: TouchEvent)
fn on_touch_up(&mut self, event: TouchEvent)
fn on_touch_cancel(&mut self, event: TouchEvent)
pub(crate) fn on_touch_event_processed(&mut self, result: TouchEventResult)
Sourcefn simulate_mouse_click(&mut self, point: DevicePoint)
fn simulate_mouse_click(&mut self, point: DevicePoint)
pub(crate) fn notify_scroll_event( &mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint, event_type: TouchEventType, )
fn on_scroll_window_event( &mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint, )
pub(crate) fn process_pending_scroll_events( &mut self, compositor: &mut IOCompositor, )
Sourcefn scroll_node_at_device_point(
&mut self,
cursor: DevicePoint,
scroll_location: ScrollLocation,
) -> Option<(PipelineId, ExternalScrollId, LayoutVector2D)>
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.
pub(crate) fn pinch_zoom_level(&self) -> Scale<f32, DevicePixel, DevicePixel>
fn set_pinch_zoom_level(&mut self, zoom: f32) -> bool
pub(crate) fn set_page_zoom(&mut self, magnification: f32)
pub(crate) fn device_pixels_per_page_pixel( &self, ) -> Scale<f32, CSSPixel, DevicePixel>
pub(crate) fn device_pixels_per_page_pixel_not_including_pinch_zoom( &self, ) -> Scale<f32, CSSPixel, DevicePixel>
Sourcepub(crate) fn set_pinch_zoom(&mut self, magnification: f32)
pub(crate) fn set_pinch_zoom(&mut self, magnification: f32)
Simulate a pinch zoom
fn send_window_size_message(&self)
Sourcepub(crate) fn set_hidpi_scale_factor(
&mut self,
new_scale: Scale<f32, DeviceIndependentPixel, DevicePixel>,
) -> bool
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.
Sourcepub(crate) fn set_rect(&mut self, new_rect: DeviceRect) -> bool
pub(crate) fn set_rect(&mut self, new_rect: DeviceRect) -> bool
Set the rect
for this renderer, returning true
if the value actually changed.
pub(crate) fn client_window_rect( &self, rendering_context_size: Size2D<u32, DevicePixel>, ) -> Box2D<i32, DeviceIndependentPixel>
pub(crate) fn screen_size(&self) -> Size2D<i32, DeviceIndependentPixel>
pub(crate) fn available_screen_size( &self, ) -> Size2D<i32, DeviceIndependentPixel>
Trait Implementations§
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> 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