aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/layout_interface.rs
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2014-06-06 12:45:14 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2014-06-09 15:46:51 -0700
commit89327aa5bee97100b858cd33024418bd1d149940 (patch)
tree6b99e64f3a0db75689a31e6c288221a27b0b1be8 /src/components/script/layout_interface.rs
parente98b03f581912c5bd5175138a3d8dd45fc70a226 (diff)
downloadservo-89327aa5bee97100b858cd33024418bd1d149940.tar.gz
servo-89327aa5bee97100b858cd33024418bd1d149940.zip
Outside of compositor, store window size in CSS px
This fixes an issue where the CSS viewport was too large on high-DPI displays because it was set to the window size in device pixels, instead of px. This patch ensures that the window size is converted from device pixels to px before being passed to script/layout code. The Window trait now exposes the window size in both device pixels and density-independent screen coordinates, with clearer method names.
Diffstat (limited to 'src/components/script/layout_interface.rs')
-rw-r--r--src/components/script/layout_interface.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/script/layout_interface.rs b/src/components/script/layout_interface.rs
index 4b69efea010..a91309446c7 100644
--- a/src/components/script/layout_interface.rs
+++ b/src/components/script/layout_interface.rs
@@ -11,10 +11,10 @@ use dom::node::{Node, LayoutDataRef};
use geom::point::Point2D;
use geom::rect::Rect;
-use geom::size::Size2D;
+use geom::size::TypedSize2D;
use libc::c_void;
use script_task::{ScriptChan};
-use servo_util::geometry::Au;
+use servo_util::geometry::{Au, PagePx};
use std::cmp;
use std::comm::{channel, Receiver, Sender};
use style::Stylesheet;
@@ -137,7 +137,7 @@ pub struct Reflow {
/// The channel through which messages can be sent back to the script task.
pub script_chan: ScriptChan,
/// The current window size.
- pub window_size: Size2D<uint>,
+ pub window_size: TypedSize2D<PagePx, f32>,
/// The channel that we send a notification to.
pub script_join_chan: Sender<()>,
/// Unique identifier