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.
This commit is contained in:
Matt Brubeck 2014-06-06 12:45:14 -07:00
parent e98b03f581
commit 89327aa5be
15 changed files with 104 additions and 85 deletions

View file

@ -10,14 +10,16 @@ use dom::bindings::error::Fallible;
use dom::eventtarget::EventTarget;
use dom::window::Window;
use servo_util::str::DOMString;
use servo_util::geometry::PagePx;
use std::cell::Cell;
use geom::point::Point2D;
use geom::size::TypedSize2D;
use time;
pub enum Event_ {
ResizeEvent(uint, uint),
ResizeEvent(TypedSize2D<PagePx, f32>),
ReflowEvent,
ClickEvent(uint, Point2D<f32>),
MouseDownEvent(uint, Point2D<f32>),