mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update app_units to 0.4.1
This commit is contained in:
parent
f05491166f
commit
2230332f46
16 changed files with 39 additions and 40 deletions
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -57,7 +57,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "app_units"
|
name = "app_units"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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"
|
name = "gfx"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"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"
|
name = "layout"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"canvas_traits 0.0.1",
|
"canvas_traits 0.0.1",
|
||||||
|
@ -1424,7 +1424,7 @@ dependencies = [
|
||||||
name = "layout_thread"
|
name = "layout_thread"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx 0.0.1",
|
"gfx 0.0.1",
|
||||||
|
@ -2308,7 +2308,7 @@ name = "script"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"angle 0.2.0 (git+https://github.com/servo/angle?branch=servo)",
|
"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)",
|
"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)",
|
"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)",
|
"base64 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2388,7 +2388,7 @@ dependencies = [
|
||||||
name = "script_layout_interface"
|
name = "script_layout_interface"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"canvas_traits 0.0.1",
|
"canvas_traits 0.0.1",
|
||||||
"cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2671,7 +2671,7 @@ dependencies = [
|
||||||
name = "servo_geometry"
|
name = "servo_geometry"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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"
|
name = "style"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"bindgen 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2871,7 +2871,7 @@ dependencies = [
|
||||||
name = "style_tests"
|
name = "style_tests"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2892,7 +2892,7 @@ dependencies = [
|
||||||
name = "style_traits"
|
name = "style_traits"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3283,7 +3283,7 @@ name = "webrender"
|
||||||
version = "0.39.0"
|
version = "0.39.0"
|
||||||
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
|
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3312,7 +3312,7 @@ name = "webrender_traits"
|
||||||
version = "0.39.0"
|
version = "0.39.0"
|
||||||
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
|
source = "git+https://github.com/servo/webrender#4ab9b9b00b00c93a51469775f56c53eeea68b5ab"
|
||||||
dependencies = [
|
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)",
|
"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)",
|
"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)",
|
"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 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 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 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 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 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"
|
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
|
||||||
|
|
|
@ -14,6 +14,6 @@ path = "lib.rs"
|
||||||
servo = ["euclid/unstable"]
|
servo = ["euclid/unstable"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
euclid = "0.11"
|
euclid = "0.11"
|
||||||
heapsize = "0.3.0"
|
heapsize = "0.3.0"
|
||||||
|
|
|
@ -6,7 +6,7 @@ extern crate app_units;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
#[macro_use] extern crate heapsize;
|
#[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::point::Point2D;
|
||||||
use euclid::rect::Rect;
|
use euclid::rect::Rect;
|
||||||
use euclid::size::Size2D;
|
use euclid::size::Size2D;
|
||||||
|
@ -38,7 +38,7 @@ known_heap_size!(0, DeviceIndependentPixel);
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn max_rect() -> Rect<Au> {
|
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.
|
/// A helper function to convert a rect of `f32` pixels to a rect of app units.
|
||||||
|
|
|
@ -11,7 +11,7 @@ name = "gfx"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
bitflags = "0.7"
|
bitflags = "0.7"
|
||||||
euclid = "0.11"
|
euclid = "0.11"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
|
|
|
@ -110,7 +110,7 @@ pub type DetailedGlyphCount = u16;
|
||||||
impl GlyphEntry {
|
impl GlyphEntry {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn advance(&self) -> Au {
|
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]
|
#[inline]
|
||||||
|
@ -629,7 +629,7 @@ impl<'a> GlyphStore {
|
||||||
leftover_spaces += 1;
|
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.
|
/// When SIMD isn't available, fallback to the slow path.
|
||||||
|
|
|
@ -404,7 +404,7 @@ impl Shaper {
|
||||||
if character == ' ' || character == '\u{a0}' {
|
if character == ' ' || character == '\u{a0}' {
|
||||||
// https://drafts.csswg.org/css-text-3/#word-spacing-property
|
// https://drafts.csswg.org/css-text-3/#word-spacing-property
|
||||||
let (length, percent) = options.word_spacing;
|
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
|
advance
|
||||||
|
|
|
@ -10,7 +10,7 @@ name = "layout"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
bitflags = "0.7"
|
bitflags = "0.7"
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
|
|
|
@ -2,13 +2,12 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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 block::FormattingContextType;
|
||||||
use flow::{self, CLEARS_LEFT, CLEARS_RIGHT, Flow, ImmutableFlowUtils};
|
use flow::{self, CLEARS_LEFT, CLEARS_RIGHT, Flow, ImmutableFlowUtils};
|
||||||
use persistent_list::PersistentList;
|
use persistent_list::PersistentList;
|
||||||
use std::cmp::{max, min};
|
use std::cmp::{max, min};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::i32;
|
|
||||||
use style::computed_values::float;
|
use style::computed_values::float;
|
||||||
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||||
use style::values::computed::LengthOrPercentageOrAuto;
|
use style::values::computed::LengthOrPercentageOrAuto;
|
||||||
|
@ -319,7 +318,7 @@ impl Floats {
|
||||||
Au(0),
|
Au(0),
|
||||||
info.ceiling,
|
info.ceiling,
|
||||||
info.max_inline_size,
|
info.max_inline_size,
|
||||||
Au(i32::MAX))
|
MAX_AU)
|
||||||
}
|
}
|
||||||
FloatKind::Right => {
|
FloatKind::Right => {
|
||||||
return LogicalRect::new(
|
return LogicalRect::new(
|
||||||
|
@ -327,7 +326,7 @@ impl Floats {
|
||||||
info.max_inline_size - info.size.inline,
|
info.max_inline_size - info.size.inline,
|
||||||
info.ceiling,
|
info.ceiling,
|
||||||
info.max_inline_size,
|
info.max_inline_size,
|
||||||
Au(i32::MAX))
|
MAX_AU)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,7 +351,7 @@ impl Floats {
|
||||||
Au(0),
|
Au(0),
|
||||||
float_b,
|
float_b,
|
||||||
info.max_inline_size,
|
info.max_inline_size,
|
||||||
Au(i32::MAX))
|
MAX_AU)
|
||||||
}
|
}
|
||||||
FloatKind::Right => {
|
FloatKind::Right => {
|
||||||
LogicalRect::new(
|
LogicalRect::new(
|
||||||
|
@ -360,7 +359,7 @@ impl Floats {
|
||||||
info.max_inline_size - info.size.inline,
|
info.max_inline_size - info.size.inline,
|
||||||
float_b,
|
float_b,
|
||||||
info.max_inline_size,
|
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,
|
let block_size = self.max_block_size_for_bounds(rect.start.i,
|
||||||
rect.start.b,
|
rect.start.b,
|
||||||
rect.size.inline);
|
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 {
|
return match info.kind {
|
||||||
FloatKind::Left => {
|
FloatKind::Left => {
|
||||||
LogicalRect::new(
|
LogicalRect::new(
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ impl Fragment {
|
||||||
// Note: We can not precompute the ratio and store it as a float, because
|
// 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
|
// doing so may result one pixel difference in calculation for certain
|
||||||
// images, thus make some tests fail.
|
// 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)
|
intrinsic_inline_size.0 as i64) as i32)
|
||||||
} else {
|
} else {
|
||||||
intrinsic_block_size
|
intrinsic_block_size
|
||||||
|
@ -1068,7 +1068,7 @@ impl Fragment {
|
||||||
(MaybeAuto::Auto, MaybeAuto::Specified(block_size)) => {
|
(MaybeAuto::Auto, MaybeAuto::Specified(block_size)) => {
|
||||||
let block_size = block_constraint.clamp(block_size);
|
let block_size = block_constraint.clamp(block_size);
|
||||||
let inline_size = if self.has_intrinsic_ratio() {
|
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)
|
intrinsic_block_size.0 as i64) as i32)
|
||||||
} else {
|
} else {
|
||||||
intrinsic_inline_size
|
intrinsic_inline_size
|
||||||
|
@ -1084,10 +1084,10 @@ impl Fragment {
|
||||||
// First, create two rectangles that keep aspect ratio while may be clamped
|
// First, create two rectangles that keep aspect ratio while may be clamped
|
||||||
// by the contraints;
|
// by the contraints;
|
||||||
let first_isize = inline_constraint.clamp(intrinsic_inline_size);
|
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);
|
intrinsic_inline_size.0 as i64) as i32);
|
||||||
let second_bsize = block_constraint.clamp(intrinsic_block_size);
|
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);
|
intrinsic_block_size.0 as i64) as i32);
|
||||||
let (inline_size, block_size) = match (first_isize.cmp(&intrinsic_inline_size) ,
|
let (inline_size, block_size) = match (first_isize.cmp(&intrinsic_inline_size) ,
|
||||||
second_isize.cmp(&intrinsic_inline_size)) {
|
second_isize.cmp(&intrinsic_inline_size)) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
||||||
use StyleArc;
|
use StyleArc;
|
||||||
use app_units::Au;
|
use app_units::{Au, MIN_AU};
|
||||||
use block::AbsoluteAssignBSizesTraversal;
|
use block::AbsoluteAssignBSizesTraversal;
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::{DisplayListBuildState, InlineFlowDisplayListBuilding};
|
use display_list_builder::{DisplayListBuildState, InlineFlowDisplayListBuilding};
|
||||||
|
@ -1113,7 +1113,7 @@ impl InlineFlow {
|
||||||
let line_height = text::line_height_from_style(style, &font_metrics);
|
let line_height = text::line_height_from_style(style, &font_metrics);
|
||||||
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height);
|
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_top_fragments = Au(0);
|
||||||
let mut largest_block_size_for_bottom_fragments = Au(0);
|
let mut largest_block_size_for_bottom_fragments = Au(0);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ name = "layout_thread"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
euclid = "0.11"
|
euclid = "0.11"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
gfx = {path = "../gfx"}
|
gfx = {path = "../gfx"}
|
||||||
|
|
|
@ -25,7 +25,7 @@ tinyfiledialogs = "2.5.9"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
angle = {git = "https://github.com/servo/angle", branch = "servo"}
|
angle = {git = "https://github.com/servo/angle", branch = "servo"}
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
audio-video-metadata = "0.1.2"
|
audio-video-metadata = "0.1.2"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
base64 = "0.4.2"
|
base64 = "0.4.2"
|
||||||
|
|
|
@ -10,7 +10,7 @@ name = "script_layout_interface"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
cssparser = "0.13.3"
|
cssparser = "0.13.3"
|
||||||
|
|
|
@ -30,7 +30,7 @@ testing = []
|
||||||
gecko_debug = ["nsstring_vendor/gecko_debug"]
|
gecko_debug = ["nsstring_vendor/gecko_debug"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
arrayvec = "0.3.20"
|
arrayvec = "0.3.20"
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
bitflags = "0.7"
|
bitflags = "0.7"
|
||||||
|
|
|
@ -15,7 +15,7 @@ servo = ["heapsize", "heapsize_derive", "serde", "serde_derive",
|
||||||
gecko = []
|
gecko = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
cssparser = "0.13.3"
|
cssparser = "0.13.3"
|
||||||
euclid = "0.11"
|
euclid = "0.11"
|
||||||
heapsize = {version = "0.3.0", optional = true}
|
heapsize = {version = "0.3.0", optional = true}
|
||||||
|
|
|
@ -14,7 +14,7 @@ testing = ["style/testing"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.0"
|
byteorder = "1.0"
|
||||||
app_units = "0.4"
|
app_units = "0.4.1"
|
||||||
cssparser = "0.13.3"
|
cssparser = "0.13.3"
|
||||||
euclid = "0.11"
|
euclid = "0.11"
|
||||||
html5ever = "0.16"
|
html5ever = "0.16"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue