aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2017-04-19 14:45:47 +0200
committerMartin Robinson <mrobinson@igalia.com>2017-04-20 08:51:38 +0200
commitd150cc9f95c45f80a96678a3ed1c8e076f005382 (patch)
treed3f7dded41ee67b2cc86948207bcc7c74dc3f4cf /components/layout_thread/lib.rs
parent7919e591a46274c0d7f3a7c7c99d2643d55d60f1 (diff)
downloadservo-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/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 286d49484f6..fe6e6d0dea2 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -49,7 +49,7 @@ use gfx::display_list::{OpaqueNode, WebRenderImageInfo};
use gfx::font;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context;
-use gfx_traits::{Epoch, FragmentType, ScrollRootId};
+use gfx_traits::{Epoch, node_id_from_clip_id};
use heapsize::HeapSizeOf;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
@@ -514,6 +514,7 @@ impl LayoutThread {
ThreadLocalStyleContextCreationInfo::new(self.new_animations_sender.clone());
LayoutContext {
+ id: self.id,
style_context: SharedStyleContext {
stylist: rw_data.stylist.clone(),
options: StyleSystemOptions::default(),
@@ -1282,7 +1283,8 @@ impl LayoutThread {
},
ReflowQueryType::NodeScrollRootIdQuery(node) => {
let node = unsafe { ServoLayoutNode::new(&node) };
- rw_data.scroll_root_id_response = Some(process_node_scroll_root_id_request(node));
+ rw_data.scroll_root_id_response = Some(process_node_scroll_root_id_request(self.id,
+ node));
},
ReflowQueryType::ResolvedStyleQuery(node, ref pseudo, ref property) => {
let node = unsafe { ServoLayoutNode::new(&node) };
@@ -1339,12 +1341,12 @@ impl LayoutThread {
let offset = new_scroll_state.scroll_offset;
layout_scroll_states.insert(new_scroll_state.scroll_root_id, offset);
- if new_scroll_state.scroll_root_id == ScrollRootId::root() {
+ if new_scroll_state.scroll_root_id.is_root_scroll_node() {
script_scroll_states.push((UntrustedNodeAddress::from_id(0), offset))
- } else if !new_scroll_state.scroll_root_id.is_special() &&
- new_scroll_state.scroll_root_id.fragment_type() == FragmentType::FragmentBody {
- let id = new_scroll_state.scroll_root_id.id();
- script_scroll_states.push((UntrustedNodeAddress::from_id(id), offset))
+ } else if let Some(id) = new_scroll_state.scroll_root_id.external_id() {
+ if let Some(node_id) = node_id_from_clip_id(id as usize) {
+ script_scroll_states.push((UntrustedNodeAddress::from_id(node_id), offset))
+ }
}
}
let _ = self.script_chan