aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/compositing/compositor.rs3
-rw-r--r--components/compositing/lib.rs2
-rw-r--r--components/constellation/constellation.rs2
-rw-r--r--components/constellation/pipeline.rs2
-rw-r--r--components/gfx/paint_context.rs3
-rw-r--r--components/script_traits/lib.rs2
-rw-r--r--components/servo/Cargo.lock1
-rw-r--r--components/style/media_queries.rs2
-rw-r--r--components/style/viewport.rs2
-rw-r--r--components/style_traits/Cargo.toml3
-rw-r--r--components/style_traits/lib.rs29
-rw-r--r--components/style_traits/viewport.rs2
-rw-r--r--components/util/geometry.rs30
-rw-r--r--ports/cef/Cargo.lock1
-rw-r--r--ports/geckolib/Cargo.lock1
-rw-r--r--ports/geckolib/data.rs2
16 files changed, 42 insertions, 45 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 8041fd7f1df..5e5b305ca88 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -45,11 +45,12 @@ use std::mem as std_mem;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use style_traits::viewport::ViewportConstraints;
+use style_traits::{PagePx, ViewportPx};
use surface_map::SurfaceMap;
use time::{precise_time_ns, precise_time_s};
use touch::{TouchHandler, TouchAction};
use url::Url;
-use util::geometry::{PagePx, ScreenPx, ViewportPx};
+use util::geometry::ScreenPx;
use util::opts;
use util::prefs::PREFS;
use webrender;
diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs
index c76d163feb9..1f510d39e8d 100644
--- a/components/compositing/lib.rs
+++ b/components/compositing/lib.rs
@@ -43,7 +43,7 @@ use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
use std::sync::mpsc::Sender;
-use util::geometry::PagePx;
+use style_traits::PagePx;
mod compositor;
mod compositor_layer;
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 0920a4a523f..699b77ba1f1 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -53,11 +53,11 @@ use std::marker::PhantomData;
use std::mem::replace;
use std::process;
use std::sync::mpsc::{Sender, channel, Receiver};
+use style_traits::PagePx;
use style_traits::cursor::Cursor;
use style_traits::viewport::ViewportConstraints;
use timer_scheduler::TimerScheduler;
use url::Url;
-use util::geometry::PagePx;
use util::opts;
use util::prefs::PREFS;
use util::thread::spawn_named;
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs
index 5c472dc250e..bd9988364a2 100644
--- a/components/constellation/pipeline.rs
+++ b/components/constellation/pipeline.rs
@@ -31,9 +31,9 @@ use std::collections::HashMap;
use std::io::Error as IOError;
use std::process;
use std::sync::mpsc::{Sender, channel};
+use style_traits::{PagePx, ViewportPx};
use url::Url;
use util;
-use util::geometry::{PagePx, ViewportPx};
use util::ipc::OptionalIpcSender;
use util::opts::{self, Opts};
use util::prefs::{PREFS, Pref};
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs
index 5a8d8580bd6..2614e77fc82 100644
--- a/components/gfx/paint_context.rs
+++ b/components/gfx/paint_context.rs
@@ -32,9 +32,10 @@ use range::Range;
use std::default::Default;
use std::{f32, mem, ptr};
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
+use style_traits::PagePx;
use text::TextRun;
use text::glyph::ByteIndex;
-use util::geometry::{self, MAX_RECT, PagePx, ScreenPx};
+use util::geometry::{self, MAX_RECT, ScreenPx};
use util::opts;
pub struct PaintContext<'a> {
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 5c6064a3d3e..ab1a7d7ee52 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -61,8 +61,8 @@ use profile_traits::mem;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::HashMap;
use std::sync::mpsc::{Sender, Receiver};
+use style_traits::{PagePx, ViewportPx};
use url::Url;
-use util::geometry::{PagePx, ViewportPx};
use util::ipc::OptionalOpaqueIpcSender;
use webdriver_msg::{LoadStatus, WebDriverScriptCommand};
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index dad006a243c..9d43557ece1 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -2282,7 +2282,6 @@ dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "util 0.0.1",
]
[[package]]
diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs
index a3223753350..59c1a24e355 100644
--- a/components/style/media_queries.rs
+++ b/components/style/media_queries.rs
@@ -10,7 +10,7 @@ use app_units::Au;
use cssparser::{Delimiter, Parser, Token};
use euclid::size::{Size2D, TypedSize2D};
use properties::longhands;
-use util::geometry::ViewportPx;
+use style_traits::ViewportPx;
use values::specified;
diff --git a/components/style/viewport.rs b/components/style/viewport.rs
index 06411425922..175165a2864 100644
--- a/components/style/viewport.rs
+++ b/components/style/viewport.rs
@@ -18,9 +18,9 @@ use std::ascii::AsciiExt;
use std::fmt;
use std::iter::Enumerate;
use std::str::Chars;
+use style_traits::ViewportPx;
use style_traits::viewport::{Orientation, UserZoom, ViewportConstraints, Zoom};
use stylesheets::Origin;
-use util::geometry::ViewportPx;
use values::computed::{Context, ToComputedValue};
use values::specified::{Length, LengthOrPercentageOrAuto, ViewportPercentageLength};
diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml
index 4d55194fd90..18f05f72d0a 100644
--- a/components/style_traits/Cargo.toml
+++ b/components/style_traits/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
[features]
servo = ["heapsize", "heapsize_plugin", "serde", "serde_macros", "euclid/plugins",
- "cssparser/heap_size", "cssparser/serde-serialization", "util/servo"]
+ "cssparser/heap_size", "cssparser/serde-serialization"]
[dependencies]
cssparser = "0.5.4"
@@ -20,4 +20,3 @@ heapsize_plugin = {version = "0.1.2", optional = true}
rustc-serialize = "0.3"
serde = {version = "0.7.11", optional = true}
serde_macros = {version = "0.7.11", optional = true}
-util = {path = "../util"}
diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs
index 3b68e412d36..c55447d301a 100644
--- a/components/style_traits/lib.rs
+++ b/components/style_traits/lib.rs
@@ -22,7 +22,34 @@ extern crate euclid;
#[cfg(feature = "servo")] extern crate heapsize;
extern crate rustc_serialize;
#[cfg(feature = "servo")] extern crate serde;
-extern crate util;
+
+/// One CSS "px" in the coordinate system of the "initial viewport":
+/// http://www.w3.org/TR/css-device-adapt/#initial-viewport
+///
+/// ViewportPx is equal to ScreenPx times a "page zoom" factor controlled by the user. This is
+/// the desktop-style "full page" zoom that enlarges content but then reflows the layout viewport
+/// so it still exactly fits the visible area.
+///
+/// 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)]
+pub enum ViewportPx {}
+
+/// One CSS "px" in the root coordinate system for the content document.
+///
+/// PagePx is equal to ViewportPx multiplied by a "viewport zoom" factor controlled by the user.
+/// 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)]
+pub enum PagePx {}
+
+// In summary, the hierarchy of pixel units and the factors to convert from one to the next:
+//
+// DevicePixel
+// / hidpi_ratio => ScreenPx
+// / desktop_zoom => ViewportPx
+// / pinch_zoom => PagePx
pub mod cursor;
#[macro_use]
diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs
index 96075f7a5e3..deac9d68905 100644
--- a/components/style_traits/viewport.rs
+++ b/components/style_traits/viewport.rs
@@ -7,8 +7,8 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use std::ascii::AsciiExt;
use std::fmt;
-use util::geometry::{PagePx, ViewportPx};
use values::specified::AllowedNumericType;
+use {PagePx, ViewportPx};
define_css_keyword_enum!(UserZoom:
"zoom" => Zoom,
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index d750131f151..95b6194a14e 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -26,35 +26,7 @@ use std::i32;
#[derive(Clone, Copy, Debug)]
pub enum ScreenPx {}
-/// One CSS "px" in the coordinate system of the "initial viewport":
-/// http://www.w3.org/TR/css-device-adapt/#initial-viewport
-///
-/// ViewportPx is equal to ScreenPx times a "page zoom" factor controlled by the user. This is
-/// the desktop-style "full page" zoom that enlarges content but then reflows the layout viewport
-/// so it still exactly fits the visible area.
-///
-/// 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)]
-pub enum ViewportPx {}
-
-/// One CSS "px" in the root coordinate system for the content document.
-///
-/// PagePx is equal to ViewportPx multiplied by a "viewport zoom" factor controlled by the user.
-/// 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)]
-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
-// / hidpi_ratio => ScreenPx
-// / desktop_zoom => ViewportPx
-// / pinch_zoom => PagePx
+known_heap_size!(0, ScreenPx);
// An Au is an "App Unit" and represents 1/60th of a CSS pixel. It was
// originally proposed in 2002 as a standard unit of measure in Gecko.
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 019f1b0d484..d5a48dc268e 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -2151,7 +2151,6 @@ dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "util 0.0.1",
]
[[package]]
diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock
index d5a0608dde3..56ddf17d9a5 100644
--- a/ports/geckolib/Cargo.lock
+++ b/ports/geckolib/Cargo.lock
@@ -340,7 +340,6 @@ dependencies = [
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "util 0.0.1",
]
[[package]]
diff --git a/ports/geckolib/data.rs b/ports/geckolib/data.rs
index 02fdece2411..e50f98261d5 100644
--- a/ports/geckolib/data.rs
+++ b/ports/geckolib/data.rs
@@ -16,7 +16,7 @@ use style::dom::OpaqueNode;
use style::media_queries::{Device, MediaType};
use style::parallel::WorkQueueData;
use style::workqueue::WorkQueue;
-use util::geometry::ViewportPx;
+use style_traits::ViewportPx;
use util::thread_state;
pub struct PerDocumentStyleData {