servo: Merge #11398 - script: Keep the DOM-side viewport up to date when scrolling happens in WebRender (from pcwalton:webrender-viewport); r=glennw
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. r? @glennw Source-Repo: https://github.com/servo/servo Source-Revision: 27d1f182713077395426a53a9c91ec35c95887ee
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user