aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/geometry.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2016-06-21 13:55:50 +0200
committerSimon Sapin <simon.sapin@exyr.org>2016-06-22 15:40:53 +0200
commitea73c8efac8c3544880bb9e037f884e0884a7736 (patch)
tree227b2f9689a95ddea92266ca557747ce615049c5 /components/util/geometry.rs
parentb9b289c4be50402facddd38c2ce2db2f1a05519c (diff)
downloadservo-ea73c8efac8c3544880bb9e037f884e0884a7736.tar.gz
servo-ea73c8efac8c3544880bb9e037f884e0884a7736.zip
Make it possible to build the style_traits crate with a stable compiler.
Testing this on CI to make sure we don’t regress it is blocked on #11806
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r--components/util/geometry.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 813cad3aa3d..d750131f151 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -23,7 +23,7 @@ use std::i32;
///
/// The ratio between ScreenPx and DevicePixel for a given display be found by calling
/// `servo::windowing::WindowMethods::hidpi_factor`.
-#[derive(Clone, Copy, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug)]
pub enum ScreenPx {}
/// One CSS "px" in the coordinate system of the "initial viewport":
@@ -35,7 +35,7 @@ pub enum ScreenPx {}
///
/// At the default zoom level of 100%, one PagePx is equal to one ScreenPx. However, if the
/// document is zoomed in or out then this scale may be larger or smaller.
-#[derive(Clone, Copy, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug)]
pub enum ViewportPx {}
/// One CSS "px" in the root coordinate system for the content document.
@@ -44,9 +44,11 @@ pub enum ViewportPx {}
/// This is the mobile-style "pinch zoom" that enlarges content without reflowing it. When the
/// viewport zoom is not equal to 1.0, then the layout viewport is no longer the same physical size
/// as the viewable area.
-#[derive(Clone, Copy, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug)]
pub enum PagePx {}
+known_heap_size!(0, ScreenPx, ViewportPx, PagePx);
+
// In summary, the hierarchy of pixel units and the factors to convert from one to the next:
//
// DevicePixel