aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2016-08-11 00:29:19 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-08-12 03:12:06 +0200
commit6259df5e2da6574f3d5951a7df2cb511d263697a (patch)
treef68cc95e507fc7e208a3c04de637c0914bcd9d60 /components/script/dom
parentb7facf41cbc7ba727666e95fd0c390d432d862fa (diff)
downloadservo-6259df5e2da6574f3d5951a7df2cb511d263697a.tar.gz
servo-6259df5e2da6574f3d5951a7df2cb511d263697a.zip
Update to euclid 0.8
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/document.rs8
-rw-r--r--components/script/dom/window.rs12
2 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 5f1bf4c45cd..5fca33081eb 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -2807,7 +2807,7 @@ impl DocumentMethods for Document {
fn ElementFromPoint(&self, x: Finite<f64>, y: Finite<f64>) -> Option<Root<Element>> {
let x = *x as f32;
let y = *y as f32;
- let point = &Point2D { x: x, y: y };
+ let point = &Point2D::new(x, y);
let window = window_from_node(self);
let viewport = window.window_size().unwrap().visible_viewport;
@@ -2815,7 +2815,7 @@ impl DocumentMethods for Document {
return None;
}
- if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
+ if x < 0.0 || y < 0.0 || x > viewport.width || y > viewport.height {
return None;
}
@@ -2840,7 +2840,7 @@ impl DocumentMethods for Document {
fn ElementsFromPoint(&self, x: Finite<f64>, y: Finite<f64>) -> Vec<Root<Element>> {
let x = *x as f32;
let y = *y as f32;
- let point = &Point2D { x: x, y: y };
+ let point = &Point2D::new(x, y);
let window = window_from_node(self);
let viewport = window.window_size().unwrap().visible_viewport;
@@ -2849,7 +2849,7 @@ impl DocumentMethods for Document {
}
// Step 2
- if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
+ if x < 0.0 || y < 0.0 || x > viewport.width || y > viewport.height {
return vec!();
}
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index e6e527aea9c..e728e38a451 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -103,7 +103,7 @@ use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle, OneshotTimers
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
use tinyfiledialogs::{self, MessageBoxIcon};
use url::Url;
-use util::geometry::{self, MAX_RECT};
+use util::geometry::{self, max_rect};
use util::opts;
use util::prefs::PREFS;
use webdriver_handlers::jsval_to_webdriver;
@@ -751,7 +751,7 @@ impl WindowMethods for Window {
//TODO Include Scrollbar
fn InnerHeight(&self) -> i32 {
self.window_size.get()
- .and_then(|e| e.visible_viewport.height.get().to_i32())
+ .and_then(|e| e.visible_viewport.height.to_i32())
.unwrap_or(0)
}
@@ -759,7 +759,7 @@ impl WindowMethods for Window {
//TODO Include Scrollbar
fn InnerWidth(&self) -> i32 {
self.window_size.get()
- .and_then(|e| e.visible_viewport.width.get().to_i32())
+ .and_then(|e| e.visible_viewport.width.to_i32())
.unwrap_or(0)
}
@@ -1529,7 +1529,7 @@ impl Window {
return false;
}
- let had_clip_rect = clip_rect != MAX_RECT;
+ let had_clip_rect = clip_rect != max_rect();
if had_clip_rect && !should_move_clip_rect(clip_rect, viewport) {
return false;
}
@@ -1537,7 +1537,7 @@ impl Window {
self.page_clip_rect.set(proposed_clip_rect);
// If we didn't have a clip rect, the previous display doesn't need rebuilding
- // because it was built for infinite clip (MAX_RECT).
+ // because it was built for infinite clip (max_rect()).
had_clip_rect
}
@@ -1721,7 +1721,7 @@ impl Window {
resource_threads: resource_threads,
bluetooth_thread: bluetooth_thread,
constellation_chan: constellation_chan,
- page_clip_rect: Cell::new(MAX_RECT),
+ page_clip_rect: Cell::new(max_rect()),
fragment_name: DOMRefCell::new(None),
resize_event: Cell::new(None),
next_subpage_id: Cell::new(SubpageId(0)),