aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/page.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-12-17 18:45:49 -0700
committerbors-servo <metajack+bors@gmail.com>2014-12-17 18:45:49 -0700
commitfbf42c951b2f53d91e2f32f8035484a07ea83493 (patch)
tree1d7bfb30cbddebba633fe1f2c8844cf4133aabc1 /components/script/page.rs
parentb8900782b0fcb409f37189bdc08eb7f8b3564a5f (diff)
parent1a9be88a1d1f9138287f5b1ee04300b7e1bd7025 (diff)
downloadservo-fbf42c951b2f53d91e2f32f8035484a07ea83493.tar.gz
servo-fbf42c951b2f53d91e2f32f8035484a07ea83493.zip
auto merge of #4405 : servo/servo/rustup_20141124, r=jdm
Diffstat (limited to 'components/script/page.rs')
-rw-r--r--components/script/page.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/page.rs b/components/script/page.rs
index c5b1f74c73a..c4c0f741c4c 100644
--- a/components/script/page.rs
+++ b/components/script/page.rs
@@ -33,7 +33,7 @@ use servo_util::smallvec::SmallVec;
use std::cell::{Cell, Ref, RefMut};
use std::comm::{channel, Receiver, Empty, Disconnected};
use std::mem::replace;
-use std::num::abs;
+use std::num::Float;
use std::rc::Rc;
use url::Url;
@@ -456,10 +456,10 @@ fn should_move_clip_rect(clip_rect: Rect<Au>, new_viewport: Rect<f32>) -> bool{
static VIEWPORT_SCROLL_MARGIN_SIZE: f32 = 0.5;
let viewport_scroll_margin = new_viewport.size * VIEWPORT_SCROLL_MARGIN_SIZE;
- abs(clip_rect.origin.x - new_viewport.origin.x) <= viewport_scroll_margin.width ||
- abs(clip_rect.max_x() - new_viewport.max_x()) <= viewport_scroll_margin.width ||
- abs(clip_rect.origin.y - new_viewport.origin.y) <= viewport_scroll_margin.height ||
- abs(clip_rect.max_y() - new_viewport.max_y()) <= viewport_scroll_margin.height
+ (clip_rect.origin.x - new_viewport.origin.x).abs() <= viewport_scroll_margin.width ||
+ (clip_rect.max_x() - new_viewport.max_x()).abs() <= viewport_scroll_margin.width ||
+ (clip_rect.origin.y - new_viewport.origin.y).abs() <= viewport_scroll_margin.height ||
+ (clip_rect.max_y() - new_viewport.max_y()).abs() <= viewport_scroll_margin.height
}
/// Information for one frame in the browsing context.