mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
script: Keep the DOM-side viewport up to date when scrolling happens in
WebRender. This happens asynchronously, just as it does in non-WebRender mode. This functionality is a prerequisite for doing proper display-list-based hit testing in WebRender, since it moves the scroll offsets into Servo (and, specifically, into the script thread, enabling iframe event forwarding) instead of keeping them private to WebRender. Requires servo/webrender_traits#55 and servo/webrender#277. Partially addresses #11108.
This commit is contained in:
parent
55b0bb027c
commit
a86f77e36d
32 changed files with 318 additions and 99 deletions
|
@ -39,6 +39,7 @@ use euclid::point::Point2D;
|
|||
use euclid::rect::Rect;
|
||||
use gfx_traits::Epoch;
|
||||
use gfx_traits::LayerId;
|
||||
use gfx_traits::StackingContextId;
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
use libc::c_void;
|
||||
use msg::constellation_msg::{FrameId, FrameType, Key, KeyModifiers, KeyState, LoadData};
|
||||
|
@ -76,6 +77,8 @@ pub enum LayoutControlMsg {
|
|||
TickAnimations,
|
||||
/// Informs layout as to which regions of the page are visible.
|
||||
SetVisibleRects(Vec<(LayerId, Rect<Au>)>),
|
||||
/// Tells layout about the new scrolling offsets of each scrollable stacking context.
|
||||
SetStackingContextScrollStates(Vec<StackingContextScrollState>),
|
||||
/// Requests the current load state of Web fonts. `true` is returned if fonts are still loading
|
||||
/// and `false` is returned if all fonts have loaded.
|
||||
GetWebFontLoadState(IpcSender<bool>),
|
||||
|
@ -122,6 +125,8 @@ pub enum ConstellationControlMsg {
|
|||
SendEvent(PipelineId, CompositorEvent),
|
||||
/// Notifies script of the viewport.
|
||||
Viewport(PipelineId, Rect<f32>),
|
||||
/// Notifies script of a new scroll offset.
|
||||
SetScrollState(PipelineId, Point2D<f32>),
|
||||
/// Requests that the script thread immediately send the constellation the title of a pipeline.
|
||||
GetTitle(PipelineId),
|
||||
/// Notifies script thread to suspend all its timers
|
||||
|
@ -463,6 +468,15 @@ pub enum AnimationTickType {
|
|||
Layout,
|
||||
}
|
||||
|
||||
/// The scroll state of a stacking context.
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct StackingContextScrollState {
|
||||
/// The ID of the stacking context.
|
||||
pub stacking_context_id: StackingContextId,
|
||||
/// The scrolling offset of this stacking context.
|
||||
pub scroll_offset: Point2D<f32>,
|
||||
}
|
||||
|
||||
/// Messages to the constellation.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum ConstellationMsg {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue