aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2017-05-17 13:07:12 -0700
committerManish Goregaokar <manishsmail@gmail.com>2017-05-19 20:33:02 -0700
commit2230332f460bea9550bfc07affa129ae64ae49b7 (patch)
treec3fecc2ac8bf3067770de0dc3f2289573e0bcf9b
parentf05491166f21879f74758b2f03bbc4c4a4c31eb8 (diff)
downloadservo-2230332f460bea9550bfc07affa129ae64ae49b7.tar.gz
servo-2230332f460bea9550bfc07affa129ae64ae49b7.zip
Update app_units to 0.4.1
-rw-r--r--Cargo.lock26
-rw-r--r--components/geometry/Cargo.toml2
-rw-r--r--components/geometry/lib.rs4
-rw-r--r--components/gfx/Cargo.toml2
-rw-r--r--components/gfx/text/glyph.rs4
-rw-r--r--components/gfx/text/shaping/harfbuzz.rs2
-rw-r--r--components/layout/Cargo.toml2
-rw-r--r--components/layout/floats.rs13
-rw-r--r--components/layout/fragment.rs8
-rw-r--r--components/layout/inline.rs4
-rw-r--r--components/layout_thread/Cargo.toml2
-rw-r--r--components/script/Cargo.toml2
-rw-r--r--components/script_layout_interface/Cargo.toml2
-rw-r--r--components/style/Cargo.toml2
-rw-r--r--components/style_traits/Cargo.toml2
-rw-r--r--tests/unit/style/Cargo.toml2
16 files changed, 39 insertions, 40 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2ef4d663720..77d1550ad41 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -57,7 +57,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "app_units"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -985,7 +985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "gfx"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1372,7 +1372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "layout"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
@@ -1424,7 +1424,7 @@ dependencies = [
name = "layout_thread"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
@@ -2308,7 +2308,7 @@ name = "script"
version = "0.0.1"
dependencies = [
"angle 0.2.0 (git+https://github.com/servo/angle?branch=servo)",
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"audio-video-metadata 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2388,7 +2388,7 @@ dependencies = [
name = "script_layout_interface"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2671,7 +2671,7 @@ dependencies = [
name = "servo_geometry"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2823,7 +2823,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "style"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2871,7 +2871,7 @@ dependencies = [
name = "style_tests"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2892,7 +2892,7 @@ dependencies = [
name = "style_traits"
version = "0.0.1"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3283,7 +3283,7 @@ name = "webrender"
version = "0.39.0"
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)",
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3312,7 +3312,7 @@ name = "webrender_traits"
version = "0.39.0"
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
dependencies = [
- "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3433,7 +3433,7 @@ dependencies = [
"checksum angle 0.2.0 (git+https://github.com/servo/angle?branch=servo)" = "<none>"
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
-"checksum app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a0c3b5be4ed53affe3e1a162b2e7ef9979bcaac80daa9026e9d7988c41e0e83"
+"checksum app_units 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c89beb28482985f88b312de4021d748f45b3eecec6cc8dbaf0c2b3c3d1ce6da5"
"checksum arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d89f1b0e242270b5b797778af0c8d182a1a2ccac5d8d6fadf414223cc0fab096"
"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
diff --git a/components/geometry/Cargo.toml b/components/geometry/Cargo.toml
index 73368f5dfbf..a004a8936aa 100644
--- a/components/geometry/Cargo.toml
+++ b/components/geometry/Cargo.toml
@@ -14,6 +14,6 @@ path = "lib.rs"
servo = ["euclid/unstable"]
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
euclid = "0.11"
heapsize = "0.3.0"
diff --git a/components/geometry/lib.rs b/components/geometry/lib.rs
index 55c1a165295..453cf0997c5 100644
--- a/components/geometry/lib.rs
+++ b/components/geometry/lib.rs
@@ -6,7 +6,7 @@ extern crate app_units;
extern crate euclid;
#[macro_use] extern crate heapsize;
-use app_units::{Au, MAX_AU};
+use app_units::{Au, MAX_AU, MIN_AU};
use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::size::Size2D;
@@ -38,7 +38,7 @@ known_heap_size!(0, DeviceIndependentPixel);
#[inline(always)]
pub fn max_rect() -> Rect<Au> {
- Rect::new(Point2D::new(Au(i32::MIN / 2), Au(i32::MIN / 2)), Size2D::new(MAX_AU, MAX_AU))
+ Rect::new(Point2D::new(MIN_AU / 2, MIN_AU / 2), Size2D::new(MAX_AU, MAX_AU))
}
/// A helper function to convert a rect of `f32` pixels to a rect of app units.
diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml
index 62238ac44a6..843f7f833c7 100644
--- a/components/gfx/Cargo.toml
+++ b/components/gfx/Cargo.toml
@@ -11,7 +11,7 @@ name = "gfx"
path = "lib.rs"
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
bitflags = "0.7"
euclid = "0.11"
fnv = "1.0"
diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs
index 513ac8fd65a..21692cd8d5f 100644
--- a/components/gfx/text/glyph.rs
+++ b/components/gfx/text/glyph.rs
@@ -110,7 +110,7 @@ pub type DetailedGlyphCount = u16;
impl GlyphEntry {
#[inline(always)]
fn advance(&self) -> Au {
- Au(((self.value & GLYPH_ADVANCE_MASK) >> GLYPH_ADVANCE_SHIFT) as i32)
+ Au::new(((self.value & GLYPH_ADVANCE_MASK) >> GLYPH_ADVANCE_SHIFT) as i32)
}
#[inline]
@@ -629,7 +629,7 @@ impl<'a> GlyphStore {
leftover_spaces += 1;
}
}
- Au(advance) + leftover_advance + extra_word_spacing * (spaces + leftover_spaces)
+ Au::new(advance) + leftover_advance + extra_word_spacing * (spaces + leftover_spaces)
}
/// When SIMD isn't available, fallback to the slow path.
diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs
index 0449961ded1..19827c2b191 100644
--- a/components/gfx/text/shaping/harfbuzz.rs
+++ b/components/gfx/text/shaping/harfbuzz.rs
@@ -404,7 +404,7 @@ impl Shaper {
if character == ' ' || character == '\u{a0}' {
// https://drafts.csswg.org/css-text-3/#word-spacing-property
let (length, percent) = options.word_spacing;
- advance = (advance + length) + Au((advance.0 as f32 * percent.into_inner()) as i32);
+ advance = (advance + length) + Au::new((advance.0 as f32 * percent.into_inner()) as i32);
}
advance
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index f6fb8b5f9de..483314d2e90 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -10,7 +10,7 @@ name = "layout"
path = "lib.rs"
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
atomic_refcell = "0.1"
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
diff --git a/components/layout/floats.rs b/components/layout/floats.rs
index d7e419a9740..aa3c02d1d3f 100644
--- a/components/layout/floats.rs
+++ b/components/layout/floats.rs
@@ -2,13 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use app_units::Au;
+use app_units::{Au, MAX_AU};
use block::FormattingContextType;
use flow::{self, CLEARS_LEFT, CLEARS_RIGHT, Flow, ImmutableFlowUtils};
use persistent_list::PersistentList;
use std::cmp::{max, min};
use std::fmt;
-use std::i32;
use style::computed_values::float;
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use style::values::computed::LengthOrPercentageOrAuto;
@@ -319,7 +318,7 @@ impl Floats {
Au(0),
info.ceiling,
info.max_inline_size,
- Au(i32::MAX))
+ MAX_AU)
}
FloatKind::Right => {
return LogicalRect::new(
@@ -327,7 +326,7 @@ impl Floats {
info.max_inline_size - info.size.inline,
info.ceiling,
info.max_inline_size,
- Au(i32::MAX))
+ MAX_AU)
}
}
}
@@ -352,7 +351,7 @@ impl Floats {
Au(0),
float_b,
info.max_inline_size,
- Au(i32::MAX))
+ MAX_AU)
}
FloatKind::Right => {
LogicalRect::new(
@@ -360,7 +359,7 @@ impl Floats {
info.max_inline_size - info.size.inline,
float_b,
info.max_inline_size,
- Au(i32::MAX))
+ MAX_AU)
}
}
}
@@ -373,7 +372,7 @@ impl Floats {
let block_size = self.max_block_size_for_bounds(rect.start.i,
rect.start.b,
rect.size.inline);
- let block_size = block_size.unwrap_or(Au(i32::MAX));
+ let block_size = block_size.unwrap_or(MAX_AU);
return match info.kind {
FloatKind::Left => {
LogicalRect::new(
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index f98e711d397..9ba2f697e5a 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -1058,7 +1058,7 @@ impl Fragment {
// Note: We can not precompute the ratio and store it as a float, because
// doing so may result one pixel difference in calculation for certain
// images, thus make some tests fail.
- Au((inline_size.0 as i64 * intrinsic_block_size.0 as i64 /
+ Au::new((inline_size.0 as i64 * intrinsic_block_size.0 as i64 /
intrinsic_inline_size.0 as i64) as i32)
} else {
intrinsic_block_size
@@ -1068,7 +1068,7 @@ impl Fragment {
(MaybeAuto::Auto, MaybeAuto::Specified(block_size)) => {
let block_size = block_constraint.clamp(block_size);
let inline_size = if self.has_intrinsic_ratio() {
- Au((block_size.0 as i64 * intrinsic_inline_size.0 as i64 /
+ Au::new((block_size.0 as i64 * intrinsic_inline_size.0 as i64 /
intrinsic_block_size.0 as i64) as i32)
} else {
intrinsic_inline_size
@@ -1084,10 +1084,10 @@ impl Fragment {
// First, create two rectangles that keep aspect ratio while may be clamped
// by the contraints;
let first_isize = inline_constraint.clamp(intrinsic_inline_size);
- let first_bsize = Au((first_isize.0 as i64 * intrinsic_block_size.0 as i64 /
+ let first_bsize = Au::new((first_isize.0 as i64 * intrinsic_block_size.0 as i64 /
intrinsic_inline_size.0 as i64) as i32);
let second_bsize = block_constraint.clamp(intrinsic_block_size);
- let second_isize = Au((second_bsize.0 as i64 * intrinsic_inline_size.0 as i64 /
+ let second_isize = Au::new((second_bsize.0 as i64 * intrinsic_inline_size.0 as i64 /
intrinsic_block_size.0 as i64) as i32);
let (inline_size, block_size) = match (first_isize.cmp(&intrinsic_inline_size) ,
second_isize.cmp(&intrinsic_inline_size)) {
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index d8cd4003ab3..3ffdd275c71 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -5,7 +5,7 @@
#![deny(unsafe_code)]
use StyleArc;
-use app_units::Au;
+use app_units::{Au, MIN_AU};
use block::AbsoluteAssignBSizesTraversal;
use context::LayoutContext;
use display_list_builder::{DisplayListBuildState, InlineFlowDisplayListBuilding};
@@ -1113,7 +1113,7 @@ impl InlineFlow {
let line_height = text::line_height_from_style(style, &font_metrics);
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height);
- let mut line_metrics = LineMetrics::new(Au(0), Au(i32::MIN));
+ let mut line_metrics = LineMetrics::new(Au(0), MIN_AU);
let mut largest_block_size_for_top_fragments = Au(0);
let mut largest_block_size_for_bottom_fragments = Au(0);
diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml
index ea89a21c257..db17f93524b 100644
--- a/components/layout_thread/Cargo.toml
+++ b/components/layout_thread/Cargo.toml
@@ -10,7 +10,7 @@ name = "layout_thread"
path = "lib.rs"
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
euclid = "0.11"
fnv = "1.0"
gfx = {path = "../gfx"}
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index 141bb95f78f..8752120cb89 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -25,7 +25,7 @@ tinyfiledialogs = "2.5.9"
[dependencies]
angle = {git = "https://github.com/servo/angle", branch = "servo"}
-app_units = "0.4"
+app_units = "0.4.1"
audio-video-metadata = "0.1.2"
atomic_refcell = "0.1"
base64 = "0.4.2"
diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml
index 2dff0e25259..d7bbca3a2b3 100644
--- a/components/script_layout_interface/Cargo.toml
+++ b/components/script_layout_interface/Cargo.toml
@@ -10,7 +10,7 @@ name = "script_layout_interface"
path = "lib.rs"
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.13.3"
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index ef60be1ab18..125545a052f 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -30,7 +30,7 @@ testing = []
gecko_debug = ["nsstring_vendor/gecko_debug"]
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
arrayvec = "0.3.20"
atomic_refcell = "0.1"
bitflags = "0.7"
diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml
index 9ee5e2b8557..cb460050775 100644
--- a/components/style_traits/Cargo.toml
+++ b/components/style_traits/Cargo.toml
@@ -15,7 +15,7 @@ servo = ["heapsize", "heapsize_derive", "serde", "serde_derive",
gecko = []
[dependencies]
-app_units = "0.4"
+app_units = "0.4.1"
cssparser = "0.13.3"
euclid = "0.11"
heapsize = {version = "0.3.0", optional = true}
diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml
index 185b83b8c5c..2c56e93a4f9 100644
--- a/tests/unit/style/Cargo.toml
+++ b/tests/unit/style/Cargo.toml
@@ -14,7 +14,7 @@ testing = ["style/testing"]
[dependencies]
byteorder = "1.0"
-app_units = "0.4"
+app_units = "0.4.1"
cssparser = "0.13.3"
euclid = "0.11"
html5ever = "0.16"