mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Move WindowSizeData to script_traits.
This commit is contained in:
parent
54bb138ddc
commit
b8fe9e9637
14 changed files with 40 additions and 44 deletions
|
@ -5,33 +5,16 @@
|
|||
//! The high-level interface from script to constellation. Using this abstract interface helps
|
||||
//! reduce coupling between these two components.
|
||||
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::size::TypedSize2D;
|
||||
use hyper::header::Headers;
|
||||
use hyper::method::Method;
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use layers::geometry::DevicePixel;
|
||||
use std::cell::Cell;
|
||||
use std::fmt;
|
||||
use url::Url;
|
||||
use util::geometry::{PagePx, ViewportPx};
|
||||
use webrender_traits;
|
||||
|
||||
pub type PanicMsg = (Option<PipelineId>, String, String);
|
||||
|
||||
#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub struct WindowSizeData {
|
||||
/// The size of the initial layout viewport, before parsing an
|
||||
/// http://www.w3.org/TR/css-device-adapt/#initial-viewport
|
||||
pub initial_viewport: TypedSize2D<ViewportPx, f32>,
|
||||
|
||||
/// The "viewing area" in page px. See `PagePx` documentation for details.
|
||||
pub visible_viewport: TypedSize2D<PagePx, f32>,
|
||||
|
||||
/// The resolution of the window in dppx, not including any "pinch zoom" factor.
|
||||
pub device_pixel_ratio: ScaleFactor<ViewportPx, DevicePixel, f32>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Eq, PartialEq, Serialize, Copy, Clone, HeapSizeOf)]
|
||||
pub enum WindowSizeType {
|
||||
Initial,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue