aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-06-14 07:25:05 -0700
committerGitHub <noreply@github.com>2017-06-14 07:25:05 -0700
commit18653f69581693a5bae1ce4e350e78bc16159b08 (patch)
treec231afafc66f7f3e2404769e083c176d2a13057d /components/script/dom/window.rs
parent5dce166266d1f74e2ae88dbe52ca5ced75c2349b (diff)
parent997608f11f6dfa79291ead25cae46a0538f2a3dc (diff)
downloadservo-18653f69581693a5bae1ce4e350e78bc16159b08.tar.gz
servo-18653f69581693a5bae1ce4e350e78bc16159b08.zip
Auto merge of #17184 - nical:euclid-bump, r=SimonSapin
Bump euclid to 0.14.x. - [x] `./mach build -d` does not report any errors (kinda, need webrender published and Cargo.toml fixed up) - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because it is a refactoring in which the difference is mostly a compile-time/strong-typing thing with no change to the logic. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17184) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index c4ec3c07248..1f6a7c26eea 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -53,7 +53,7 @@ use dom::windowproxy::WindowProxy;
use dom::worklet::Worklet;
use dom::workletglobalscope::WorkletGlobalScopeType;
use dom_struct::dom_struct;
-use euclid::{Point2D, Rect, Size2D};
+use euclid::{Point2D, Vector2D, Rect, Size2D};
use fetch;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
@@ -255,7 +255,7 @@ pub struct Window {
error_reporter: CSSErrorReporter,
/// A list of scroll offsets for each scrollable element.
- scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Point2D<f32>>>,
+ scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Vector2D<f32>>>,
/// All the MediaQueryLists we need to update
media_query_lists: WeakMediaQueryListVec,
@@ -365,7 +365,7 @@ impl Window {
/// Sets a new list of scroll offsets.
///
/// This is called when layout gives us new ones and WebRender is in use.
- pub fn set_scroll_offsets(&self, offsets: HashMap<UntrustedNodeAddress, Point2D<f32>>) {
+ pub fn set_scroll_offsets(&self, offsets: HashMap<UntrustedNodeAddress, Vector2D<f32>>) {
*self.scroll_offsets.borrow_mut() = offsets
}
@@ -1155,7 +1155,7 @@ impl Window {
self.layout_chan.send(Msg::UpdateScrollStateFromScript(ScrollState {
scroll_root_id: scroll_root_id,
- scroll_offset: Point2D::new(-x, -y),
+ scroll_offset: Vector2D::new(-x, -y),
})).unwrap();
// TODO (farodin91): Raise an event to stop the current_viewport
@@ -1449,7 +1449,7 @@ impl Window {
self.layout_rpc.node_overflow().0.unwrap()
}
- pub fn scroll_offset_query(&self, node: &Node) -> Point2D<f32> {
+ pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> {
let mut node = Root::from_ref(node);
loop {
if let Some(scroll_offset) = self.scroll_offsets
@@ -1462,8 +1462,8 @@ impl Window {
None => break,
}
}
- let offset = self.current_viewport.get().origin;
- Point2D::new(offset.x.to_f32_px(), offset.y.to_f32_px())
+ let vp_origin = self.current_viewport.get().origin;
+ Vector2D::new(vp_origin.x.to_f32_px(), vp_origin.y.to_f32_px())
}
// https://drafts.csswg.org/cssom-view/#dom-element-scroll