aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/paint_task.rs4
-rw-r--r--components/layout/display_list_builder.rs4
-rw-r--r--components/layout/fragment.rs14
-rw-r--r--components/style/legacy.rs4
-rw-r--r--components/style/properties.mako.rs2
-rw-r--r--components/util/geometry.rs18
6 files changed, 23 insertions, 23 deletions
diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs
index 77adfc3c15b..1a2dcd18f1a 100644
--- a/components/gfx/paint_task.rs
+++ b/components/gfx/paint_task.rs
@@ -575,8 +575,8 @@ impl WorkerThread {
// painted this tile.
let color = THREAD_TINT_COLORS[thread_id % THREAD_TINT_COLORS.len()];
paint_context.draw_solid_color(&Rect(Point2D(Au(0), Au(0)),
- Size2D(Au::from_px(size.width as isize),
- Au::from_px(size.height as isize))),
+ Size2D(Au::from_px(size.width),
+ Au::from_px(size.height))),
color);
}
}
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 2794563fd46..7c4ee2b5066 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -353,8 +353,8 @@ impl FragmentDisplayListBuilding for Fragment {
// wide.
let image_aspect_ratio = (image.width as f64) / (image.height as f64);
let bounds_aspect_ratio = bounds.size.width.to_f64_px() / bounds.size.height.to_f64_px();
- let intrinsic_size = Size2D(Au::from_px(image.width as isize),
- Au::from_px(image.height as isize));
+ let intrinsic_size = Size2D(Au::from_px(image.width as i32),
+ Au::from_px(image.height as i32));
match (style.get_background().background_size.clone(),
image_aspect_ratio < bounds_aspect_ratio) {
(background_size::T::Contain, false) | (background_size::T::Cover, true) => {
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 13c602b6d41..7b451d608ad 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -271,8 +271,8 @@ impl CanvasFragmentInfo {
pub fn new(node: &ThreadSafeLayoutNode) -> CanvasFragmentInfo {
CanvasFragmentInfo {
replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node,
- Some(Au::from_px(node.get_canvas_width() as isize)),
- Some(Au::from_px(node.get_canvas_height() as isize))),
+ Some(Au::from_px(node.get_canvas_width() as i32)),
+ Some(Au::from_px(node.get_canvas_height() as i32))),
renderer: node.get_renderer().map(|rec| Arc::new(Mutex::new(rec))),
}
}
@@ -309,8 +309,8 @@ impl ImageFragmentInfo {
fn convert_length(node: &ThreadSafeLayoutNode, name: &Atom) -> Option<Au> {
let element = node.as_element();
element.get_attr(&ns!(""), name)
- .and_then(|string| string.parse::<isize>().ok())
- .map(|pixels| Au::from_px(pixels))
+ .and_then(|string| string.parse().ok())
+ .map(Au::from_px)
}
let image = url.and_then(|url| layout_context.get_or_request_image(url));
@@ -331,7 +331,7 @@ impl ImageFragmentInfo {
image.height
} else {
image.width
- } as isize)
+ } as i32)
}
None => Au(0)
}
@@ -345,7 +345,7 @@ impl ImageFragmentInfo {
image.width
} else {
image.height
- } as isize)
+ } as i32)
}
None => Au(0)
}
@@ -354,7 +354,7 @@ impl ImageFragmentInfo {
/// Tile an image
pub fn tile_image(position: &mut Au, size: &mut Au,
virtual_position: Au, image_size: u32) {
- let image_size = image_size as isize;
+ let image_size = image_size as i32;
let delta_pixels = (virtual_position - *position).to_px();
let tile_count = (delta_pixels + image_size - 1) / image_size;
let offset = Au::from_px(image_size * tile_count);
diff --git a/components/style/legacy.rs b/components/style/legacy.rs
index f3a66f5138a..1b3cac694c0 100644
--- a/components/style/legacy.rs
+++ b/components/style/legacy.rs
@@ -126,7 +126,7 @@ impl PresentationalHintSynthesis for Stylist {
UnsignedIntegerAttribute::CellSpacing) {
None => {}
Some(length) => {
- let width_value = specified::Length::Absolute(Au::from_px(length as isize));
+ let width_value = specified::Length::Absolute(Au::from_px(length as i32));
matching_rules_list.push(from_declaration(
PropertyDeclaration::BorderSpacing(
SpecifiedValue(
@@ -204,7 +204,7 @@ impl PresentationalHintSynthesis for Stylist {
match element.get_unsigned_integer_attribute(UnsignedIntegerAttribute::Border) {
None => {}
Some(length) => {
- let width_value = specified::Length::Absolute(Au::from_px(length as isize));
+ let width_value = specified::Length::Absolute(Au::from_px(length as i32));
matching_rules_list.push(from_declaration(
PropertyDeclaration::BorderTopWidth(SpecifiedValue(
longhands::border_top_width::SpecifiedValue(width_value)))));
diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs
index ef577d083d1..1b869806c17 100644
--- a/components/style/properties.mako.rs
+++ b/components/style/properties.mako.rs
@@ -1681,7 +1681,7 @@ pub mod longhands {
use util::geometry::Au;
pub type T = Au;
}
- const MEDIUM_PX: isize = 16;
+ const MEDIUM_PX: i32 = 16;
#[inline] pub fn get_initial_value() -> computed_value::T {
Au::from_px(MEDIUM_PX)
}
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 684b06183f8..8f40e92e397 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -201,7 +201,7 @@ impl Au {
}
#[inline]
- pub fn from_px(px: isize) -> Au {
+ pub fn from_px(px: i32) -> Au {
Au((px * 60) as i32)
}
@@ -212,29 +212,29 @@ impl Au {
/// Rounds this app unit down to the pixel towards zero and returns it.
#[inline]
- pub fn to_px(&self) -> isize {
+ pub fn to_px(&self) -> i32 {
let Au(a) = *self;
- (a / 60) as isize
+ (a / 60)
}
/// Rounds this app unit down to the previous (left or top) pixel and returns it.
#[inline]
- pub fn to_prev_px(&self) -> isize {
+ pub fn to_prev_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).floor() as isize
+ ((s as f64) / 60f64).floor() as i32
}
/// Rounds this app unit up to the next (right or bottom) pixel and returns it.
#[inline]
- pub fn to_next_px(&self) -> isize {
+ pub fn to_next_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).ceil() as isize
+ ((s as f64) / 60f64).ceil() as i32
}
#[inline]
- pub fn to_nearest_px(&self) -> isize {
+ pub fn to_nearest_px(&self) -> i32 {
let Au(s) = *self;
- ((s as f64) / 60f64).round() as isize
+ ((s as f64) / 60f64).round() as i32
}
#[inline]