diff options
author | Martin Robinson <mrobinson@igalia.com> | 2017-04-19 14:45:47 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2017-04-20 08:51:38 +0200 |
commit | d150cc9f95c45f80a96678a3ed1c8e076f005382 (patch) | |
tree | d3f7dded41ee67b2cc86948207bcc7c74dc3f4cf /components/script | |
parent | 7919e591a46274c0d7f3a7c7c99d2643d55d60f1 (diff) | |
download | servo-d150cc9f95c45f80a96678a3ed1c8e076f005382.tar.gz servo-d150cc9f95c45f80a96678a3ed1c8e076f005382.zip |
Eliminate ScrollRootId
Just use WebRender's ClipId directly. This will allow us to create and
use ReferenceFrames in the future, if we need to do that. It will also
make it easier to have Servo responsible for creating the root
scrolling area, which will allow removing some old hacks in the future.
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/document.rs | 6 | ||||
-rw-r--r-- | components/script/dom/window.rs | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 940baaca36f..427282630d5 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -93,7 +93,6 @@ use dom_struct::dom_struct; use encoding::EncodingRef; use encoding::all::UTF_8; use euclid::point::Point2D; -use gfx_traits::ScrollRootId; use html5ever_atoms::{LocalName, QualName}; use hyper::header::{Header, SetCookie}; use hyper_serde::Serde; @@ -143,6 +142,7 @@ use time; use timers::OneshotTimerCallback; use url::Host; use url::percent_encoding::percent_decode; +use webrender_traits::ClipId; /// The number of times we are allowed to see spurious `requestAnimationFrame()` calls before /// falling back to fake ones. @@ -699,9 +699,11 @@ impl Document { if let Some((x, y)) = point { // Step 3 + let global_scope = self.window.upcast::<GlobalScope>(); + let webrender_pipeline_id = global_scope.pipeline_id().to_webrender(); self.window.perform_a_scroll(x, y, - ScrollRootId::root(), + ClipId::root_scroll_node(webrender_pipeline_id), ScrollBehavior::Instant, target.r()); } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 0c8ea1a6594..df7fe995c1f 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -52,7 +52,6 @@ use dom::testrunner::TestRunner; use dom_struct::dom_struct; use euclid::{Point2D, Rect, Size2D}; use fetch; -use gfx_traits::ScrollRootId; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use js::jsapi::{HandleObject, HandleValue, JSAutoCompartment, JSContext}; @@ -122,6 +121,7 @@ use timers::{IsInterval, TimerCallback}; use tinyfiledialogs::{self, MessageBoxIcon}; use url::Position; use webdriver_handlers::jsval_to_webdriver; +use webrender_traits::ClipId; use webvr_traits::WebVRMsg; /// Current state of the window object @@ -1077,9 +1077,10 @@ impl Window { //TODO Step 11 //let document = self.Document(); // Step 12 + let global_scope = self.upcast::<GlobalScope>(); self.perform_a_scroll(x.to_f32().unwrap_or(0.0f32), y.to_f32().unwrap_or(0.0f32), - ScrollRootId::root(), + global_scope.pipeline_id().root_scroll_node(), behavior, None); } @@ -1088,7 +1089,7 @@ impl Window { pub fn perform_a_scroll(&self, x: f32, y: f32, - scroll_root_id: ScrollRootId, + scroll_root_id: ClipId, behavior: ScrollBehavior, element: Option<&Element>) { //TODO Step 1 @@ -1108,8 +1109,7 @@ impl Window { self.update_viewport_for_scroll(x, y); let global_scope = self.upcast::<GlobalScope>(); - let message = ConstellationMsg::ScrollFragmentPoint( - global_scope.pipeline_id(), scroll_root_id, point, smooth); + let message = ConstellationMsg::ScrollFragmentPoint(scroll_root_id, point, smooth); global_scope.constellation_chan().send(message).unwrap(); } |