Bug 1611948 - Rename ClipScrollTree into SpatialTree. r=gw
authorNicolas Silva <nsilva@mozilla.com>
Wed, 29 Jan 2020 10:43:20 +0000
changeset 512076 f1bc648538a8d2c0f5a36bf422335311e202cc22
parent 512075 c36ea2be8f87325fe028d86aada16bd1d8a89775
child 512077 7ce86d93798cb3875d51ab1e17102e795090b0d8
push id37069
push usercbrindusan@mozilla.com
push dateWed, 29 Jan 2020 21:37:21 +0000
treeherdermozilla-central@7cde282c17e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1611948
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1611948 - Rename ClipScrollTree into SpatialTree. r=gw There is nothing clipping related in there anymore. Differential Revision: https://phabricator.services.mozilla.com/D61178
gfx/wr/webrender/doc/CLIPPING_AND_POSITIONING.md
gfx/wr/webrender/src/batch.rs
gfx/wr/webrender/src/clip.rs
gfx/wr/webrender/src/clip_scroll_tree.rs
gfx/wr/webrender/src/debug_server.rs
gfx/wr/webrender/src/frame_builder.rs
gfx/wr/webrender/src/gpu_types.rs
gfx/wr/webrender/src/hit_test.rs
gfx/wr/webrender/src/lib.rs
gfx/wr/webrender/src/picture.rs
gfx/wr/webrender/src/prim_store/backdrop.rs
gfx/wr/webrender/src/prim_store/mod.rs
gfx/wr/webrender/src/prim_store/text_run.rs
gfx/wr/webrender/src/render_backend.rs
gfx/wr/webrender/src/render_target.rs
gfx/wr/webrender/src/render_task.rs
gfx/wr/webrender/src/scene.rs
gfx/wr/webrender/src/scene_building.rs
gfx/wr/webrender/src/spatial_node.rs
gfx/wr/webrender/src/spatial_tree.rs
gfx/wr/webrender/src/util.rs
gfx/wr/webrender_api/src/api.rs
gfx/wr/webrender_api/src/display_item.rs
--- a/gfx/wr/webrender/doc/CLIPPING_AND_POSITIONING.md
+++ b/gfx/wr/webrender/doc/CLIPPING_AND_POSITIONING.md
@@ -15,19 +15,19 @@ fails when dealing with important edges 
  4. Completely non-hierarchical clipping situations, such as when items are
     clipped by some clips in the hierarchy, but not others.
 
 Design changes have been a step by step path from the original design to one
 that can handle all CSS content.
 
 # Current Design
 
-All positioning and clipping is handled by the `ClipScrollTree`. The name is a
+All positioning and clipping is handled by the `SpatialTree`. The name is a
 holdover from when this tree was a tree of `Layers` which handled both
-positioning and clipping. Currently the `ClipScrollTree` holds:
+positioning and clipping. Currently the `SpatialTree` holds:
  1. A hierarchical collection of `SpatialNodes`, with the final screen
     transformation of each node depending on the relative transformation of the
     node combined with the transformations of all of its ancestors. These nodes
     are responsible for positioning display list items and clips.
  2. A collection of `ClipNodes` which specify a rectangular clip and, optionally,
     a set of rounded rectangle clips and a masking image.
  3. A collection of `ClipChains`. Each `ClipChain` is a list of `ClipNode`
     elements. Every display list item has an assigned `ClipChain` which
@@ -52,17 +52,17 @@ There are three types of `SpatialNodes`:
      to can adjust this position relative to the reference frame origin.
   2. Scrolling nodes are used to define scrolling areas. These nodes have scroll
      offsets which are a 2D translation relative to ancestor nodes and, ultimately,
      the reference frame origin.
   3. Sticky frames are responsible for implementing position:sticky behavior.
      This is also an 2D translation.
 
 `SpatialNodes` are defined as items in the display list. After scene building
-each node is traversed hierarchically during the `ClipScrollTree::update()` step.
+each node is traversed hierarchically during the `SpatialTree::update()` step.
 Once reference frame transforms and relative offsets are calculated, a to screen
 space transformation can be calculated for each `SpatialNode`. This transformation
 is added the `TransformPalette` and becomes directly available to WebRender shaders.
 
 In addition to screen space transformation calculation, the `SpatialNode` tree
 is divided up into _compatible coordinate systems_. These are coordinate systems
 which differ only by 2D translations from their parent system. These compatible
 coordinate systems may even cross reference frame boundaries. The goal here is
@@ -74,17 +74,17 @@ coordinate systems without generating ma
 Each clip node holds a clip rectangle along with an optional collection of
 rounded clip rectangles and a mask image. The fact that `ClipNodes` all have a
 clip rectangle is important because it means that all content clipped by a
 clip node has a bounding rectangle, which can be converted into a bounding
 screen space rectangle.  This rectangle is called the _outer rectangle_ of the
 clip. `ClipNodes` may also have an _inner rectangle_, which is an area within
 the boundaries of the _outer rectangle_ that is completely unclipped.
 
-These rectangles are calculated during the `ClipScrollTree::update()` phase. In
+These rectangles are calculated during the `SpatialTree::update()` phase. In
 addition, each `ClipNode` produces a template `ClipChainNode` used to build
 the `ClipChains` which use that node.
 
 ## `ClipChains`
 
 There are two ways that `ClipChains` are defined in WebRender. The first is
 through using the API for manually specifying `ClipChains` via a parent
 `ClipChain` and a list of `ClipNodes`. The second is through the hierarchy of a
@@ -122,29 +122,29 @@ never result in the creation of a clip m
 ## Converting user-exposed `ClipId`/`SpatialId` to internal indices
 
 WebRender must access `ClipNodes` and `SpatialNodes` quite a bit when building
 scenes and frames, so it tries to convert `ClipId`/`SpatialId`, which are already
 per-pipeline indices, to global scene-wide indices.  Internally this is a
 conversion from `ClipId` into `ClipNodeIndex` or `ClipChainIndex`, and from
 `SpatialId` into `SpatialNodeIndex`. In order to make this conversion cheaper, the
 `DisplayListFlattner` assigns offsets for each pipeline and node type in the
-scene-wide `ClipScrollTree`.
+scene-wide `SpatialTree`.
 
 Nodes are added to their respective arrays sequentially as the display list is
 processed during scene building. When encountering an iframe, the
 `DisplayListFlattener` must start processing the nodes for that iframe's
 pipeline, meaning that nodes are now being added out of order to the node arrays
-of the `ClipScrollTree`. In this case, the `ClipScrollTree` fills in the gaps in
+of the `SpatialTree`. In this case, the `SpatialTree` fills in the gaps in
 the node arrays with placeholder nodes.
 
 # Hit Testing
 
 Hit testing is the responsibility of the `HitTester` data structure. This
 structure copies information necessary for hit testing from the
-`ClipScrollTree`. This is done so that hit testing can still take place while a
-new `ClipScrollTree` is under construction.
+`SpatialTree`. This is done so that hit testing can still take place while a
+new `SpatialTree` is under construction.
 
 # Ideas for the Future
 1. Expose the difference between `ClipId` and `ClipChainId` in the API.
-2. Prevent having to duplicate the `ClipScrollTree` for hit testing.
-3. Avoid having to create placeholder nodes in the `ClipScrollTree` while
+2. Prevent having to duplicate the `SpatialTree` for hit testing.
+3. Avoid having to create placeholder nodes in the `SpatialTree` while
    processing iframes.
--- a/gfx/wr/webrender/src/batch.rs
+++ b/gfx/wr/webrender/src/batch.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{AlphaType, ClipMode, ExternalImageType, ImageRendering};
 use api::{YuvColorSpace, YuvFormat, ColorDepth, ColorRange, PremultipliedColorF};
 use api::units::*;
 use crate::clip::{ClipDataStore, ClipNodeFlags, ClipNodeRange, ClipItemKind, ClipStore};
-use crate::clip_scroll_tree::{ClipScrollTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex, CoordinateSystemId};
+use crate::spatial_tree::{SpatialTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex, CoordinateSystemId};
 use crate::composite::{CompositeState};
 use crate::glyph_rasterizer::GlyphFormat;
 use crate::gpu_cache::{GpuBlockData, GpuCache, GpuCacheHandle, GpuCacheAddress};
 use crate::gpu_types::{BrushFlags, BrushInstance, PrimitiveHeaders, ZBufferId, ZBufferIdGenerator};
 use crate::gpu_types::{ClipMaskInstance, SplitCompositeInstance, BrushShaderKind};
 use crate::gpu_types::{PrimitiveInstanceData, RasterizationSpace, GlyphInstance};
 use crate::gpu_types::{PrimitiveHeader, PrimitiveHeaderIndex, TransformPaletteId, TransformPalette};
 use crate::internal_types::{FastHashMap, SavedTargetIndex, Swizzle, TextureSource, Filter};
@@ -713,17 +713,17 @@ impl BatchBuilder {
         debug_assert_eq!(prim_instance.prepared_frame_id, render_tasks.frame_id());
 
         let is_chased = prim_instance.is_chased();
 
         let transform_id = transforms
             .get_id(
                 prim_spatial_node_index,
                 root_spatial_node_index,
-                ctx.clip_scroll_tree,
+                ctx.spatial_tree,
             );
 
         // TODO(gw): Calculating this for every primitive is a bit
         //           wasteful. We should probably cache this in
         //           the scroll node...
         let transform_kind = transform_id.transform_kind();
         let prim_info = &ctx.scratch.prim_info[prim_instance.visibility_info.0 as usize];
         let bounding_rect = &prim_info.clip_chain.pic_clip_rect;
@@ -1132,17 +1132,17 @@ impl BatchBuilder {
                             let prim_header = PrimitiveHeader {
                                 local_rect: pic.precise_local_rect,
                                 local_clip_rect: child_prim_info.combined_local_clip_rect,
                                 specific_prim_address: GpuCacheAddress::INVALID,
                                 transform_id: transforms
                                     .get_id(
                                         child.spatial_node_index,
                                         root_spatial_node_index,
-                                        ctx.clip_scroll_tree,
+                                        ctx.spatial_tree,
                                     ),
                             };
 
                             let raster_config = pic
                                 .raster_config
                                 .as_ref()
                                 .expect("BUG: 3d primitive was not assigned a surface");
                             let (uv_rect_address, _) = render_tasks.resolve_surface(
@@ -1205,17 +1205,17 @@ impl BatchBuilder {
                                 // Tile cache instances are added to the composite config, rather than
                                 // directly added to batches. This allows them to be drawn with various
                                 // present modes during render, such as partial present etc.
                                 let tile_cache = picture.tile_cache.as_ref().unwrap();
                                 let map_local_to_world = SpaceMapper::new_with_target(
                                     ROOT_SPATIAL_NODE_INDEX,
                                     tile_cache.spatial_node_index,
                                     ctx.screen_world_rect,
-                                    ctx.clip_scroll_tree,
+                                    ctx.spatial_tree,
                                 );
                                 let local_tile_clip_rect = LayoutRect::from_untyped(&tile_cache.local_rect.to_untyped());
                                 let local_tile_clip_rect = match local_tile_clip_rect.intersection(&prim_info.combined_local_clip_rect) {
                                     Some(rect) => rect,
                                     None => {
                                         return;
                                     }
                                 };
@@ -2828,41 +2828,41 @@ impl ClipBatcher {
 
     /// Where appropriate, draw a clip rectangle as a small series of tiles,
     /// instead of one large rectangle.
     fn add_tiled_clip_mask(
         &mut self,
         mask_screen_rect: DeviceIntRect,
         local_clip_rect: LayoutRect,
         clip_spatial_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         world_rect: &WorldRect,
         device_pixel_scale: DevicePixelScale,
         gpu_address: GpuCacheAddress,
         instance: &ClipMaskInstance,
         is_first_clip: bool,
     ) -> bool {
         // Only try to draw in tiles if the clip mark is big enough.
         if mask_screen_rect.area() < CLIP_RECTANGLE_AREA_THRESHOLD {
             return false;
         }
 
-        let clip_spatial_node = &clip_scroll_tree
+        let clip_spatial_node = &spatial_tree
             .spatial_nodes[clip_spatial_node_index.0 as usize];
 
         // Only support clips that are axis-aligned to the root coordinate space,
         // for now, to simplify the logic below. This handles the vast majority
         // of real world cases, but could be expanded in future if needed.
         if clip_spatial_node.coordinate_system_id != CoordinateSystemId::root() {
             return false;
         }
 
         // Get the world rect of the clip rectangle. If we can't transform it due
         // to the matrix, just fall back to drawing the entire clip mask.
-        let transform = clip_scroll_tree.get_world_transform(
+        let transform = spatial_tree.get_world_transform(
             clip_spatial_node_index,
         );
         let world_clip_rect = match project_rect(
             &transform.into_transform(),
             &local_clip_rect,
             world_rect,
         ) {
             Some(rect) => rect,
@@ -2932,17 +2932,17 @@ impl ClipBatcher {
 
     pub fn add(
         &mut self,
         clip_node_range: ClipNodeRange,
         root_spatial_node_index: SpatialNodeIndex,
         resource_cache: &ResourceCache,
         gpu_cache: &GpuCache,
         clip_store: &ClipStore,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         transforms: &mut TransformPalette,
         clip_data_store: &ClipDataStore,
         actual_rect: DeviceIntRect,
         world_rect: &WorldRect,
         device_pixel_scale: DevicePixelScale,
         task_origin: DevicePoint,
         screen_origin: DevicePoint,
     ) {
@@ -2950,23 +2950,23 @@ impl ClipBatcher {
 
         for i in 0 .. clip_node_range.count {
             let clip_instance = clip_store.get_instance_from_range(&clip_node_range, i);
             let clip_node = &clip_data_store[clip_instance.handle];
 
             let clip_transform_id = transforms.get_id(
                 clip_node.item.spatial_node_index,
                 ROOT_SPATIAL_NODE_INDEX,
-                clip_scroll_tree,
+                spatial_tree,
             );
 
             let prim_transform_id = transforms.get_id(
                 root_spatial_node_index,
                 ROOT_SPATIAL_NODE_INDEX,
-                clip_scroll_tree,
+                spatial_tree,
             );
 
             let instance = ClipMaskInstance {
                 clip_transform_id,
                 prim_transform_id,
                 clip_data_address: GpuCacheAddress::INVALID,
                 resource_address: GpuCacheAddress::INVALID,
                 local_pos: LayoutPoint::zero(),
@@ -3073,17 +3073,17 @@ impl ClipBatcher {
                         false
                     } else {
                         let gpu_address = gpu_cache.get_address(&clip_node.gpu_cache_handle);
 
                         if !self.add_tiled_clip_mask(
                             actual_rect,
                             rect,
                             clip_node.item.spatial_node_index,
-                            clip_scroll_tree,
+                            spatial_tree,
                             world_rect,
                             device_pixel_scale,
                             gpu_address,
                             &instance,
                             is_first_clip,
                         ) {
                             self.get_batch_list(is_first_clip)
                                 .slow_rectangles
--- a/gfx/wr/webrender/src/clip.rs
+++ b/gfx/wr/webrender/src/clip.rs
@@ -92,17 +92,17 @@
 //! [segment.rs]: ../segment/index.html
 //!
 
 use api::{BorderRadius, ClipIntern, ClipMode, ComplexClipRegion, ImageMask};
 use api::{BoxShadowClipMode, ImageKey, ImageRendering};
 use api::units::*;
 use crate::border::{ensure_no_corner_overlap, BorderRadiusAu};
 use crate::box_shadow::{BLUR_SAMPLE_SCALE, BoxShadowClipSource, BoxShadowCacheKey};
-use crate::clip_scroll_tree::{ROOT_SPATIAL_NODE_INDEX, ClipScrollTree, SpatialNodeIndex};
+use crate::spatial_tree::{ROOT_SPATIAL_NODE_INDEX, SpatialTree, SpatialNodeIndex};
 use crate::ellipse::Ellipse;
 use crate::gpu_cache::{GpuCache, GpuCacheHandle, ToGpuBlocks};
 use crate::gpu_types::{BoxShadowStretchMode};
 use crate::image::{self, Repetition};
 use crate::intern;
 use crate::prim_store::{ClipData, ImageMaskData, SpaceMapper, VisibleMaskImageTile};
 use crate::prim_store::{PointKey, SizeKey, RectangleKey};
 use crate::render_task_cache::to_cache_size;
@@ -284,36 +284,36 @@ enum ClipSpaceConversion {
     Transform(LayoutToWorldTransform),
 }
 
 impl ClipSpaceConversion {
     /// Construct a new clip space converter between two spatial nodes.
     fn new(
         prim_spatial_node_index: SpatialNodeIndex,
         clip_spatial_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> Self {
         //Note: this code is different from `get_relative_transform` in a way that we only try
         // getting the relative transform if it's Local or ScaleOffset,
         // falling back to the world transform otherwise.
-        let clip_spatial_node = &clip_scroll_tree
+        let clip_spatial_node = &spatial_tree
             .spatial_nodes[clip_spatial_node_index.0 as usize];
-        let prim_spatial_node = &clip_scroll_tree
+        let prim_spatial_node = &spatial_tree
             .spatial_nodes[prim_spatial_node_index.0 as usize];
 
         if prim_spatial_node_index == clip_spatial_node_index {
             ClipSpaceConversion::Local
         } else if prim_spatial_node.coordinate_system_id == clip_spatial_node.coordinate_system_id {
             let scale_offset = prim_spatial_node.content_transform
                 .inverse()
                 .accumulate(&clip_spatial_node.content_transform);
             ClipSpaceConversion::ScaleOffset(scale_offset)
         } else {
             ClipSpaceConversion::Transform(
-                clip_scroll_tree
+                spatial_tree
                     .get_world_transform(clip_spatial_node_index)
                     .into_transform()
             )
         }
     }
 
     fn to_flags(&self) -> ClipNodeFlags {
         match *self {
@@ -341,29 +341,29 @@ struct ClipNodeInfo {
 
 impl ClipNodeInfo {
     fn create_instance(
         &self,
         node: &ClipNode,
         clipped_rect: &LayoutRect,
         gpu_cache: &mut GpuCache,
         resource_cache: &mut ResourceCache,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         request_resources: bool,
     ) -> Option<ClipNodeInstance> {
         // Calculate some flags that are required for the segment
         // building logic.
         let mut flags = self.conversion.to_flags();
 
         // Some clip shaders support a fast path mode for simple clips.
         // TODO(gw): We could also apply fast path when segments are created, since we only write
         //           the mask for a single corner at a time then, so can always consider radii uniform.
         let is_raster_2d =
             flags.contains(ClipNodeFlags::SAME_COORD_SYSTEM) ||
-            clip_scroll_tree
+            spatial_tree
                 .get_world_viewport_transform(node.item.spatial_node_index)
                 .is_2d_axis_aligned();
         if is_raster_2d && node.item.kind.supports_fast_path_rendering() {
             flags |= ClipNodeFlags::USE_FAST_PATH;
         }
 
         let mut visible_tiles = None;
 
@@ -747,81 +747,81 @@ impl ClipStore {
     }
 
     /// Setup the active clip chains for building a clip chain instance.
     pub fn set_active_clips(
         &mut self,
         local_prim_clip_rect: LayoutRect,
         spatial_node_index: SpatialNodeIndex,
         clip_chains: &[ClipChainId],
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         clip_data_store: &mut ClipDataStore,
     ) {
         self.active_clip_node_info.clear();
         self.active_local_clip_rect = None;
 
         let mut local_clip_rect = local_prim_clip_rect;
 
         for clip_chain_id in clip_chains {
             let clip_chain_node = &self.clip_chain_nodes[clip_chain_id.0 as usize];
 
             if !add_clip_node_to_current_chain(
                 clip_chain_node,
                 spatial_node_index,
                 &mut local_clip_rect,
                 &mut self.active_clip_node_info,
                 clip_data_store,
-                clip_scroll_tree,
+                spatial_tree,
             ) {
                 return;
             }
         }
 
         self.active_local_clip_rect = Some(local_clip_rect);
     }
 
     /// Setup the active clip chains, based on an existing primitive clip chain instance.
     pub fn set_active_clips_from_clip_chain(
         &mut self,
         prim_clip_chain: &ClipChainInstance,
         prim_spatial_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         clip_data_store: &ClipDataStore,
     ) {
         // TODO(gw): Although this does less work than set_active_clips(), it does
         //           still do some unnecessary work (such as the clip space conversion).
         //           We could consider optimizing this if it ever shows up in a profile.
 
         self.active_clip_node_info.clear();
         self.active_local_clip_rect = Some(prim_clip_chain.local_clip_rect);
 
         let clip_instances = &self
             .clip_node_instances[prim_clip_chain.clips_range.to_range()];
         for clip_instance in clip_instances {
             let clip_node = &clip_data_store[clip_instance.handle];
             let conversion = ClipSpaceConversion::new(
                 prim_spatial_node_index,
                 clip_node.item.spatial_node_index,
-                clip_scroll_tree,
+                spatial_tree,
             );
             self.active_clip_node_info.push(ClipNodeInfo {
                 handle: clip_instance.handle,
                 conversion,
             });
         }
     }
 
     /// The main interface external code uses. Given a local primitive, positioning
     /// information, and a clip chain id, build an optimized clip chain instance.
     pub fn build_clip_chain_instance(
         &mut self,
         local_prim_rect: LayoutRect,
         prim_to_pic_mapper: &SpaceMapper<LayoutPixel, PicturePixel>,
         pic_to_world_mapper: &SpaceMapper<PicturePixel, WorldPixel>,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         gpu_cache: &mut GpuCache,
         resource_cache: &mut ResourceCache,
         device_pixel_scale: DevicePixelScale,
         world_rect: &WorldRect,
         clip_data_store: &mut ClipDataStore,
         request_resources: bool,
         is_chased: bool,
     ) -> Option<ClipChainInstance> {
@@ -892,17 +892,17 @@ impl ClipStore {
                     );
 
                     // Create the clip node instance for this clip node
                     if let Some(instance) = node_info.create_instance(
                         node,
                         &local_bounding_rect,
                         gpu_cache,
                         resource_cache,
-                        clip_scroll_tree,
+                        spatial_tree,
                         request_resources,
                     ) {
                         // As a special case, a partial accept of a clip rect that is
                         // in the same coordinate system as the primitive doesn't need
                         // a clip mask. Instead, it can be handled by the primitive
                         // vertex shader as part of the local clip rect. This is an
                         // important optimization for reducing the number of clip
                         // masks that are allocated on common pages.
@@ -1583,26 +1583,26 @@ pub fn project_inner_rect(
 // for the current clip chain. Returns false if the clip
 // results in the entire primitive being culled out.
 fn add_clip_node_to_current_chain(
     node: &ClipChainNode,
     spatial_node_index: SpatialNodeIndex,
     local_clip_rect: &mut LayoutRect,
     clip_node_info: &mut Vec<ClipNodeInfo>,
     clip_data_store: &ClipDataStore,
-    clip_scroll_tree: &ClipScrollTree,
+    spatial_tree: &SpatialTree,
 ) -> bool {
     let clip_node = &clip_data_store[node.handle];
 
     // Determine the most efficient way to convert between coordinate
     // systems of the primitive and clip node.
     let conversion = ClipSpaceConversion::new(
         spatial_node_index,
         clip_node.item.spatial_node_index,
-        clip_scroll_tree,
+        spatial_tree,
     );
 
     // If we can convert spaces, try to reduce the size of the region
     // requested, and cache the conversion information for the next step.
     if let Some(clip_rect) = clip_node.item.kind.get_local_clip_rect() {
         match conversion {
             ClipSpaceConversion::Local => {
                 *local_clip_rect = match local_clip_rect.intersection(&clip_rect) {
--- a/gfx/wr/webrender/src/debug_server.rs
+++ b/gfx/wr/webrender/src/debug_server.rs
@@ -77,17 +77,17 @@ impl ws::Handler for Server {
 
                 let cmd = if set_flags {
                     DebugCommand::SetFlags(self.debug_flags)
                 } else {
                     match string.as_str() {
                         "fetch_passes" => DebugCommand::FetchPasses,
                         "fetch_screenshot" => DebugCommand::FetchScreenshot,
                         "fetch_documents" => DebugCommand::FetchDocuments,
-                        "fetch_clip_scroll_tree" => DebugCommand::FetchClipScrollTree,
+                        "fetch_spatial_tree" => DebugCommand::FetchClipScrollTree,
                         "fetch_render_tasks" => DebugCommand::FetchRenderTasks,
                         msg => {
                             error!("unknown msg {}", msg);
                             return Ok(());
                         }
                     }
                 };
 
@@ -317,29 +317,29 @@ impl Screenshot {
         let data = encode(&output);
         Screenshot {
             kind: "screenshot",
             data
         }
     }
 }
 
-// A serializable list of debug information about clip-scroll trees
+// A serializable list of debug information about spatial trees
 // that can be sent to the client
 
 #[derive(Serialize)]
-pub struct ClipScrollTreeList {
+pub struct SpatialTreeList {
     kind: &'static str,
     root: TreeNode,
 }
 
-impl ClipScrollTreeList {
+impl SpatialTreeList {
     pub fn new() -> Self {
-        ClipScrollTreeList {
-            kind: "clip_scroll_tree",
+        SpatialTreeList {
+            kind: "spatial_tree",
             root: TreeNode::new("root"),
         }
     }
 
     pub fn add(&mut self, item: TreeNode) {
         self.root.add_child(item);
     }
 }
--- a/gfx/wr/webrender/src/frame_builder.rs
+++ b/gfx/wr/webrender/src/frame_builder.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{ColorF, DebugFlags, DocumentLayer, FontRenderMode, PremultipliedColorF};
 use api::units::*;
 use crate::batch::{BatchBuilder, AlphaBatchBuilder, AlphaBatchContainer};
 use crate::clip::{ClipStore, ClipChainStack};
-use crate::clip_scroll_tree::{ClipScrollTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex, CoordinateSystemId};
+use crate::spatial_tree::{SpatialTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex, CoordinateSystemId};
 use crate::composite::{CompositorKind, CompositeState};
 use crate::debug_render::DebugItem;
 use crate::gpu_cache::{GpuCache, GpuCacheHandle};
 use crate::gpu_types::{PrimitiveHeaders, TransformPalette, UvRectKind, ZBufferIdGenerator};
 use crate::gpu_types::TransformData;
 use crate::internal_types::{FastHashMap, PlaneSplitter, SavedTargetIndex};
 use crate::picture::{PictureUpdateState, SurfaceInfo, ROOT_SURFACE_INDEX, SurfaceIndex, RecordedDirtyRegion};
 use crate::picture::{RetainedTiles, TileCacheInstance, DirtyRegion, SurfaceRenderTasks, SubpixelMode};
@@ -107,17 +107,17 @@ impl FrameGlobalResources {
 pub struct FrameBuilder {
     /// Cache of surface tiles from the previous frame builder
     /// that can optionally be consumed by this frame builder.
     pending_retained_tiles: RetainedTiles,
     pub globals: FrameGlobalResources,
 }
 
 pub struct FrameVisibilityContext<'a> {
-    pub clip_scroll_tree: &'a ClipScrollTree,
+    pub spatial_tree: &'a SpatialTree,
     pub global_screen_world_rect: WorldRect,
     pub global_device_pixel_scale: DevicePixelScale,
     pub surfaces: &'a [SurfaceInfo],
     pub debug_flags: DebugFlags,
     pub scene_properties: &'a SceneProperties,
     pub config: FrameBuilderConfig,
 }
 
@@ -133,17 +133,17 @@ pub struct FrameVisibilityState<'a> {
     pub render_tasks: &'a mut RenderTaskGraph,
     pub composite_state: &'a mut CompositeState,
 }
 
 pub struct FrameBuildingContext<'a> {
     pub global_device_pixel_scale: DevicePixelScale,
     pub scene_properties: &'a SceneProperties,
     pub global_screen_world_rect: WorldRect,
-    pub clip_scroll_tree: &'a ClipScrollTree,
+    pub spatial_tree: &'a SpatialTree,
     pub max_local_clip: LayoutRect,
     pub debug_flags: DebugFlags,
     pub fb_config: &'a FrameBuilderConfig,
 }
 
 pub struct FrameBuildingState<'a> {
     pub render_tasks: &'a mut RenderTaskGraph,
     pub profile_counters: &'a mut FrameProfileCounters,
@@ -248,25 +248,25 @@ impl FrameBuilder {
         profile_scope!("cull");
 
         if scene.prim_store.pictures.is_empty() {
             return None
         }
 
         scratch.begin_frame();
 
-        let root_spatial_node_index = scene.clip_scroll_tree.root_reference_frame_index();
+        let root_spatial_node_index = scene.spatial_tree.root_reference_frame_index();
 
         const MAX_CLIP_COORD: f32 = 1.0e9;
 
         let frame_context = FrameBuildingContext {
             global_device_pixel_scale,
             scene_properties,
             global_screen_world_rect,
-            clip_scroll_tree: &scene.clip_scroll_tree,
+            spatial_tree: &scene.spatial_tree,
             max_local_clip: LayoutRect::new(
                 LayoutPoint::new(-MAX_CLIP_COORD, -MAX_CLIP_COORD),
                 LayoutSize::new(2.0 * MAX_CLIP_COORD, 2.0 * MAX_CLIP_COORD),
             ),
             debug_flags,
             fb_config: &scene.config,
         };
 
@@ -286,17 +286,17 @@ impl FrameBuilder {
 
         // Construct a dummy root surface, that represents the
         // main framebuffer surface.
         let root_surface = SurfaceInfo::new(
             ROOT_SPATIAL_NODE_INDEX,
             ROOT_SPATIAL_NODE_INDEX,
             0.0,
             global_screen_world_rect,
-            &scene.clip_scroll_tree,
+            &scene.spatial_tree,
             global_device_pixel_scale,
         );
         surfaces.push(root_surface);
 
         let mut retained_tiles = mem::replace(
             &mut self.pending_retained_tiles,
             RetainedTiles::new(),
         );
@@ -319,17 +319,17 @@ impl FrameBuilder {
             composite_state,
         );
 
         {
             profile_marker!("UpdateVisibility");
 
             let visibility_context = FrameVisibilityContext {
                 global_device_pixel_scale,
-                clip_scroll_tree: &scene.clip_scroll_tree,
+                spatial_tree: &scene.spatial_tree,
                 global_screen_world_rect,
                 surfaces,
                 debug_flags,
                 scene_properties,
                 config,
             };
 
             let mut visibility_state = FrameVisibilityState {
@@ -485,22 +485,22 @@ impl FrameBuilder {
             .total_primitives
             .set(scene.prim_store.prim_count());
         resource_profile.content_slices.set(scene.content_slice_count);
         resource_cache.begin_frame(stamp);
         gpu_cache.begin_frame(stamp);
 
         self.globals.update(gpu_cache);
 
-        scene.clip_scroll_tree.update_tree(
+        scene.spatial_tree.update_tree(
             pan,
             global_device_pixel_scale,
             scene_properties,
         );
-        let mut transform_palette = scene.clip_scroll_tree.build_transform_palette();
+        let mut transform_palette = scene.spatial_tree.build_transform_palette();
         scene.clip_store.clear_old_instances();
 
         let mut render_tasks = RenderTaskGraph::new(
             stamp.frame_id(),
             render_task_counters,
         );
         let mut surfaces = Vec::new();
 
@@ -512,17 +512,17 @@ impl FrameBuilder {
         // (2) If current debug flags allow picture caching
         // (3) Whether we are currently pinch zooming
         // (4) If any picture cache spatial nodes are not in the root coordinate system
         let picture_caching_is_enabled =
             scene.config.global_enable_picture_caching &&
             !debug_flags.contains(DebugFlags::DISABLE_PICTURE_CACHING) &&
             !scene.picture_cache_spatial_nodes.iter().any(|spatial_node_index| {
                 let spatial_node = &scene
-                    .clip_scroll_tree
+                    .spatial_tree
                     .spatial_nodes[spatial_node_index.0 as usize];
                 spatial_node.coordinate_system_id != CoordinateSystemId::root() ||
                     spatial_node.is_ancestor_or_self_zooming
             });
 
         let mut composite_state = CompositeState::new(
             scene.config.compositor_kind,
             picture_caching_is_enabled,
@@ -572,17 +572,17 @@ impl FrameBuilder {
                 let mut ctx = RenderTargetContext {
                     global_device_pixel_scale,
                     prim_store: &scene.prim_store,
                     resource_cache,
                     use_dual_source_blending,
                     use_advanced_blending: scene.config.gpu_supports_advanced_blend,
                     break_advanced_blend_batches: !scene.config.advanced_blend_is_coherent,
                     batch_lookback_count: scene.config.batch_lookback_count,
-                    clip_scroll_tree: &scene.clip_scroll_tree,
+                    spatial_tree: &scene.spatial_tree,
                     data_stores,
                     surfaces: &surfaces,
                     scratch,
                     screen_world_rect,
                     globals: &self.globals,
                 };
 
                 build_render_pass(
--- a/gfx/wr/webrender/src/gpu_types.rs
+++ b/gfx/wr/webrender/src/gpu_types.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{DocumentLayer, PremultipliedColorF};
 use api::units::*;
-use crate::clip_scroll_tree::{ClipScrollTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex};
+use crate::spatial_tree::{SpatialTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex};
 use crate::gpu_cache::{GpuCacheAddress, GpuDataRequest};
 use crate::internal_types::FastHashMap;
 use crate::prim_store::EdgeAaSegmentMask;
 use crate::render_task::RenderTaskAddress;
 use std::i32;
 use crate::util::{TransformedRectKind, MatrixHelpers};
 
 // Contains type that must exactly match the same structures declared in GLSL.
@@ -557,17 +557,17 @@ impl TransformPalette {
             transform.with_destination::<PicturePixel>(),
         );
     }
 
     fn get_index(
         &mut self,
         child_index: SpatialNodeIndex,
         parent_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> usize {
         if parent_index == ROOT_SPATIAL_NODE_INDEX {
             child_index.0 as usize
         } else if child_index == parent_index {
             0
         } else {
             let key = RelativeTransformKey {
                 from_index: child_index,
@@ -575,17 +575,17 @@ impl TransformPalette {
             };
 
             let metadata = &mut self.metadata;
             let transforms = &mut self.transforms;
 
             *self.map
                 .entry(key)
                 .or_insert_with(|| {
-                    let transform = clip_scroll_tree.get_relative_transform(
+                    let transform = spatial_tree.get_relative_transform(
                         child_index,
                         parent_index,
                     )
                     .into_transform()
                     .with_destination::<PicturePixel>();
 
                     register_transform(
                         metadata,
@@ -601,22 +601,22 @@ impl TransformPalette {
     // Get a transform palette id for the given spatial node.
     // TODO(gw): In the future, it will be possible to specify
     //           a coordinate system id here, to allow retrieving
     //           transforms in the local space of a given spatial node.
     pub fn get_id(
         &mut self,
         from_index: SpatialNodeIndex,
         to_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> TransformPaletteId {
         let index = self.get_index(
             from_index,
             to_index,
-            clip_scroll_tree,
+            spatial_tree,
         );
         let transform_kind = self.metadata[index].transform_kind as u32;
         TransformPaletteId(
             (index as u32) |
             (transform_kind << 24)
         )
     }
 }
--- a/gfx/wr/webrender/src/hit_test.rs
+++ b/gfx/wr/webrender/src/hit_test.rs
@@ -2,24 +2,24 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{BorderRadius, ClipMode, HitTestFlags, HitTestItem, HitTestResult, ItemTag, PrimitiveFlags};
 use api::PipelineId;
 use api::units::*;
 use crate::clip::{ClipChainId, ClipDataStore, ClipNode, ClipItemKind, ClipStore};
 use crate::clip::{rounded_rectangle_contains_point};
-use crate::clip_scroll_tree::{SpatialNodeIndex, ClipScrollTree};
+use crate::spatial_tree::{SpatialNodeIndex, SpatialTree};
 use crate::internal_types::{FastHashMap, LayoutPrimitiveInfo};
 use std::{ops, u32};
 use std::sync::Arc;
 use crate::util::LayoutToWorldFastTransform;
 
-/// A copy of important clip scroll node data to use during hit testing. This a copy of
-/// data from the ClipScrollTree that will persist as a new frame is under construction,
+/// A copy of important spatial node data to use during hit testing. This a copy of
+/// data from the SpatialTree that will persist as a new frame is under construction,
 /// allowing hit tests consistent with the currently rendered frame.
 #[derive(MallocSizeOf)]
 pub struct HitTestSpatialNode {
     /// The pipeline id of this node.
     pipeline_id: PipelineId,
 
     /// World transform for content transformed by this node.
     world_content_transform: LayoutToWorldFastTransform,
@@ -124,17 +124,17 @@ impl HitTestingSceneStats {
             clip_chain_roots_count: 0,
             items_count: 0,
         }
     }
 }
 
 /// Defines the immutable part of a hit tester for a given scene.
 /// The hit tester is recreated each time a frame is built, since
-/// it relies on the current values of the clip scroll tree.
+/// it relies on the current values of the spatial tree.
 /// However, the clip chain and item definitions don't change,
 /// so they are created once per scene, and shared between
 /// hit tester instances via Arc.
 #[derive(MallocSizeOf)]
 pub struct HitTestingScene {
     /// The list of variable clip chain roots referenced by the items.
     pub clip_chain_roots: Vec<HitTestClipChainId>,
 
@@ -213,64 +213,64 @@ pub struct HitTester {
     spatial_nodes: Vec<HitTestSpatialNode>,
     clip_chains: Vec<HitTestClipChainNode>,
     pipeline_root_nodes: FastHashMap<PipelineId, SpatialNodeIndex>,
 }
 
 impl HitTester {
     pub fn new(
         scene: Arc<HitTestingScene>,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         clip_store: &ClipStore,
         clip_data_store: &ClipDataStore,
     ) -> HitTester {
         let mut hit_tester = HitTester {
             scene,
             spatial_nodes: Vec::new(),
             clip_chains: Vec::new(),
             pipeline_root_nodes: FastHashMap::default(),
         };
-        hit_tester.read_clip_scroll_tree(
-            clip_scroll_tree,
+        hit_tester.read_spatial_tree(
+            spatial_tree,
             clip_store,
             clip_data_store,
         );
         hit_tester
     }
 
-    fn read_clip_scroll_tree(
+    fn read_spatial_tree(
         &mut self,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         clip_store: &ClipStore,
         clip_data_store: &ClipDataStore,
     ) {
         self.spatial_nodes.clear();
         self.clip_chains.clear();
 
-        self.spatial_nodes.reserve(clip_scroll_tree.spatial_nodes.len());
-        for (index, node) in clip_scroll_tree.spatial_nodes.iter().enumerate() {
+        self.spatial_nodes.reserve(spatial_tree.spatial_nodes.len());
+        for (index, node) in spatial_tree.spatial_nodes.iter().enumerate() {
             let index = SpatialNodeIndex::new(index);
 
             // If we haven't already seen a node for this pipeline, record this one as the root
             // node.
             self.pipeline_root_nodes.entry(node.pipeline_id).or_insert(index);
 
             //TODO: avoid inverting more than necessary:
             //  - if the coordinate system is non-invertible, no need to try any of these concrete transforms
             //  - if there are other places where inversion is needed, let's not repeat the step
 
             self.spatial_nodes.push(HitTestSpatialNode {
                 pipeline_id: node.pipeline_id,
-                world_content_transform: clip_scroll_tree
+                world_content_transform: spatial_tree
                     .get_world_transform(index)
                     .into_fast_transform(),
-                world_viewport_transform: clip_scroll_tree
+                world_viewport_transform: spatial_tree
                     .get_world_viewport_transform(index)
                     .into_fast_transform(),
-                external_scroll_offset: clip_scroll_tree.external_scroll_offset(index),
+                external_scroll_offset: spatial_tree.external_scroll_offset(index),
             });
         }
 
         // For each clip chain node, extract the clip node from the clip
         // data store, and store it inline with the clip chain node.
         self.clip_chains.reserve(clip_store.clip_chain_nodes.len());
         for node in &clip_store.clip_chain_nodes {
             let clip_node = &clip_data_store[node.handle];
--- a/gfx/wr/webrender/src/lib.rs
+++ b/gfx/wr/webrender/src/lib.rs
@@ -79,17 +79,17 @@ extern crate svg_fmt;
 mod profiler;
 
 mod batch;
 mod border;
 mod box_shadow;
 #[cfg(any(feature = "capture", feature = "replay"))]
 mod capture;
 mod clip;
-mod clip_scroll_tree;
+mod spatial_tree;
 mod composite;
 mod debug_colors;
 mod debug_font_data;
 mod debug_render;
 #[cfg(feature = "debugger")]
 mod debug_server;
 mod device;
 mod ellipse;
--- a/gfx/wr/webrender/src/picture.rs
+++ b/gfx/wr/webrender/src/picture.rs
@@ -70,18 +70,18 @@
 //! and compositing performance.
 
 use api::{MixBlendMode, PipelineId, PremultipliedColorF, FilterPrimitiveKind};
 use api::{PropertyBinding, PropertyBindingId, FilterPrimitive, FontRenderMode};
 use api::{DebugFlags, RasterSpace, ImageKey, ColorF, PrimitiveFlags};
 use api::units::*;
 use crate::box_shadow::{BLUR_SAMPLE_SCALE};
 use crate::clip::{ClipStore, ClipChainInstance, ClipDataHandle, ClipChainId};
-use crate::clip_scroll_tree::{ROOT_SPATIAL_NODE_INDEX,
-    ClipScrollTree, CoordinateSpaceMapping, SpatialNodeIndex, VisibleFace
+use crate::spatial_tree::{ROOT_SPATIAL_NODE_INDEX,
+    SpatialTree, CoordinateSpaceMapping, SpatialNodeIndex, VisibleFace
 };
 use crate::composite::{CompositorKind, CompositeState, NativeSurfaceId, NativeTileId};
 use crate::debug_colors;
 use euclid::{vec3, Point2D, Scale, Size2D, Vector2D, Rect, Transform3D};
 use euclid::approxeq::ApproxEq;
 use crate::filterdata::SFilterData;
 use crate::frame_builder::{FrameVisibilityContext, FrameVisibilityState};
 use crate::intern::ItemUid;
@@ -381,17 +381,17 @@ impl From<PropertyBinding<f32>> for Opac
             PropertyBinding::Value(value) => OpacityBinding::Value(value),
         }
     }
 }
 
 /// Information about the state of a spatial node value
 #[derive(Debug)]
 pub struct SpatialNodeDependency {
-    /// The current value retrieved from the clip-scroll tree.
+    /// The current value retrieved from the spatial tree.
     value: TransformKey,
     /// True if it was changed (or is new) since the last frame build.
     changed: bool,
 }
 
 // Immutable context passed to picture cache tiles during pre_update
 struct TilePreUpdateContext {
     /// Maps from picture cache coords -> world space coords.
@@ -1957,17 +1957,17 @@ impl TileCacheInstance {
             self.spatial_node_index,
             PictureRect::from_untyped(&pic_rect.to_untyped()),
         );
 
         let pic_to_world_mapper = SpaceMapper::new_with_target(
             ROOT_SPATIAL_NODE_INDEX,
             self.spatial_node_index,
             frame_context.global_screen_world_rect,
-            frame_context.clip_scroll_tree,
+            frame_context.spatial_tree,
         );
 
         // If there is a valid set of shared clips, build a clip chain instance for this,
         // which will provide a local clip rect. This is useful for establishing things
         // like whether the backdrop rect supplied by Gecko can be considered opaque.
         if self.shared_clip_chain != ClipChainId::NONE {
             let mut shared_clips = Vec::new();
             let mut current_clip_chain_id = self.shared_clip_chain;
@@ -1976,25 +1976,25 @@ impl TileCacheInstance {
                 let clip_chain_node = &frame_state.clip_store.clip_chain_nodes[current_clip_chain_id.0 as usize];
                 current_clip_chain_id = clip_chain_node.parent_clip_chain_id;
             }
 
             frame_state.clip_store.set_active_clips(
                 LayoutRect::max_rect(),
                 self.spatial_node_index,
                 &shared_clips,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
                 &mut frame_state.data_stores.clip,
             );
 
             let clip_chain_instance = frame_state.clip_store.build_clip_chain_instance(
                 LayoutRect::from_untyped(&pic_rect.to_untyped()),
                 &self.map_local_to_surface,
                 &pic_to_world_mapper,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
                 frame_state.gpu_cache,
                 frame_state.resource_cache,
                 frame_context.global_device_pixel_scale,
                 &frame_context.global_screen_world_rect,
                 &mut frame_state.data_stores.clip,
                 true,
                 false,
             );
@@ -2294,17 +2294,17 @@ impl TileCacheInstance {
 
     /// Update the dependencies for each tile for a given primitive instance.
     pub fn update_prim_dependencies(
         &mut self,
         prim_instance: &PrimitiveInstance,
         prim_spatial_node_index: SpatialNodeIndex,
         prim_clip_chain: Option<&ClipChainInstance>,
         local_prim_rect: LayoutRect,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         data_stores: &DataStores,
         clip_store: &ClipStore,
         pictures: &[PicturePrimitive],
         resource_cache: &ResourceCache,
         opacity_binding_store: &OpacityBindingStorage,
         image_instances: &ImageInstanceStorage,
         surface_index: SurfaceIndex,
         surface_spatial_node_index: SpatialNodeIndex,
@@ -2313,17 +2313,17 @@ impl TileCacheInstance {
         // is no need to add it to any primitive dependencies.
         let prim_clip_chain = match prim_clip_chain {
             Some(prim_clip_chain) => prim_clip_chain,
             None => return false,
         };
 
         self.map_local_to_surface.set_target_spatial_node(
             prim_spatial_node_index,
-            clip_scroll_tree,
+            spatial_tree,
         );
 
         // Map the primitive local rect into picture space.
         let prim_rect = match self.map_local_to_surface.map(&local_prim_rect) {
             Some(rect) => rect,
             None => return false,
         };
 
@@ -2336,17 +2336,17 @@ impl TileCacheInstance {
         // the pic_clip_rect is in the same space. If not, we need to map it from
         // the surface space into the picture cache space.
         let on_picture_surface = surface_index == self.surface_index;
         let pic_clip_rect = if on_picture_surface {
             prim_clip_chain.pic_clip_rect
         } else {
             self.map_child_pic_to_surface.set_target_spatial_node(
                 surface_spatial_node_index,
-                clip_scroll_tree,
+                spatial_tree,
             );
             self.map_child_pic_to_surface
                 .map(&prim_clip_chain.pic_clip_rect)
                 .expect("bug: unable to map clip rect to picture cache space")
         };
 
         // Get the tile coordinates in the picture space.
         let (p0, p1) = self.get_tile_coords_for_rect(&pic_clip_rect);
@@ -2526,19 +2526,19 @@ impl TileCacheInstance {
                     // primitive as an opaque backdrop rect. Several of these are conservative
                     // checks and could be relaxed in future. However, these checks
                     // are quick and capture the common cases of background rects and images.
                     // Specifically, we currently require:
                     //  - The primitive is on the main picture cache surface.
                     //  - Same coord system as picture cache (ensures rects are axis-aligned).
                     //  - No clip masks exist.
                     let same_coord_system = {
-                        let prim_spatial_node = &clip_scroll_tree
+                        let prim_spatial_node = &spatial_tree
                             .spatial_nodes[prim_spatial_node_index.0 as usize];
-                        let surface_spatial_node = &clip_scroll_tree
+                        let surface_spatial_node = &spatial_tree
                             .spatial_nodes[self.spatial_node_index.0 as usize];
 
                         prim_spatial_node.coordinate_system_id == surface_spatial_node.coordinate_system_id
                     };
 
                     same_coord_system && on_picture_surface
                 }
             };
@@ -2623,17 +2623,17 @@ impl TileCacheInstance {
                     r.intersection(&self.local_clip_rect)
                 });
 
             if let Some(backdrop_rect) = backdrop_rect {
                 let map_pic_to_world = SpaceMapper::new_with_target(
                     ROOT_SPATIAL_NODE_INDEX,
                     self.spatial_node_index,
                     frame_context.global_screen_world_rect,
-                    frame_context.clip_scroll_tree,
+                    frame_context.spatial_tree,
                 );
 
                 let world_backdrop_rect = map_pic_to_world
                     .map(&backdrop_rect)
                     .expect("bug: unable to map backdrop to world space");
 
                 frame_state.composite_state.register_occluder(
                     self.slice,
@@ -2641,17 +2641,17 @@ impl TileCacheInstance {
                 );
             }
         }
 
         // Detect if the picture cache was scrolled or scaled. In this case,
         // the device space dirty rects aren't applicable (until we properly
         // integrate with OS compositors that can handle scrolling slices).
         let root_transform = frame_context
-            .clip_scroll_tree
+            .spatial_tree
             .get_relative_transform(
                 self.spatial_node_index,
                 ROOT_SPATIAL_NODE_INDEX,
             )
             .into();
         let root_transform_changed = root_transform != self.root_transform;
         if root_transform_changed {
             self.root_transform = root_transform;
@@ -2664,17 +2664,17 @@ impl TileCacheInstance {
         // TODO(gw): Maybe remove the used_spatial_nodes set and just mutate / create these
         //           diffs inside add_prim_dependency?
         self.spatial_nodes.clear();
         for spatial_node_index in self.used_spatial_nodes.drain() {
             // Get the current relative transform.
             let mut value = get_transform_key(
                 spatial_node_index,
                 self.spatial_node_index,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
 
             // Check if the transform has changed from last frame
             let mut changed = true;
             if let Some(old_info) = self.old_spatial_nodes.remove(&spatial_node_index) {
                 if old_info.value == value {
                     // Since the transform key equality check applies epsilon, if we
                     // consider the value to be the same, store that old value to avoid
@@ -2973,24 +2973,24 @@ pub struct SurfaceInfo {
 }
 
 impl SurfaceInfo {
     pub fn new(
         surface_spatial_node_index: SpatialNodeIndex,
         raster_spatial_node_index: SpatialNodeIndex,
         inflation_factor: f32,
         world_rect: WorldRect,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         device_pixel_scale: DevicePixelScale,
     ) -> Self {
         let map_surface_to_world = SpaceMapper::new_with_target(
             ROOT_SPATIAL_NODE_INDEX,
             surface_spatial_node_index,
             world_rect,
-            clip_scroll_tree,
+            spatial_tree,
         );
 
         let pic_bounds = map_surface_to_world
             .unmap(&map_surface_to_world.bounds)
             .unwrap_or_else(PictureRect::max_rect);
 
         let map_local_to_surface = SpaceMapper::new(
             surface_spatial_node_index,
@@ -3626,20 +3626,20 @@ impl PicturePrimitive {
         }
     }
 
     /// Gets the raster space to use when rendering the picture.
     /// Usually this would be the requested raster space. However, if the
     /// picture's spatial node or one of its ancestors is being pinch zoomed
     /// then we round it. This prevents us rasterizing glyphs for every minor
     /// change in zoom level, as that would be too expensive.
-    pub fn get_raster_space(&self, clip_scroll_tree: &ClipScrollTree) -> RasterSpace {
-        let spatial_node = &clip_scroll_tree.spatial_nodes[self.spatial_node_index.0 as usize];
+    pub fn get_raster_space(&self, spatial_tree: &SpatialTree) -> RasterSpace {
+        let spatial_node = &spatial_tree.spatial_nodes[self.spatial_node_index.0 as usize];
         if spatial_node.is_ancestor_or_self_zooming {
-            let scale_factors = clip_scroll_tree
+            let scale_factors = spatial_tree
                 .get_relative_transform(self.spatial_node_index, ROOT_SPATIAL_NODE_INDEX)
                 .scale_factors();
 
             // Round the scale up to the nearest power of 2, but don't exceed 8.
             let scale = scale_factors.0.max(scale_factors.1).min(8.0);
             let rounded_up = 2.0f32.powf(scale.log2().ceil());
 
             RasterSpace::Local(rounded_up)
@@ -3691,32 +3691,32 @@ impl PicturePrimitive {
                 )
             }
         };
 
         let map_pic_to_world = SpaceMapper::new_with_target(
             ROOT_SPATIAL_NODE_INDEX,
             surface_spatial_node_index,
             frame_context.global_screen_world_rect,
-            frame_context.clip_scroll_tree,
+            frame_context.spatial_tree,
         );
 
         let pic_bounds = map_pic_to_world.unmap(&map_pic_to_world.bounds)
                                          .unwrap_or_else(PictureRect::max_rect);
 
         let map_local_to_pic = SpaceMapper::new(
             surface_spatial_node_index,
             pic_bounds,
         );
 
         let (map_raster_to_world, map_pic_to_raster) = create_raster_mappers(
             surface_spatial_node_index,
             raster_spatial_node_index,
             frame_context.global_screen_world_rect,
-            frame_context.clip_scroll_tree,
+            frame_context.spatial_tree,
         );
 
         let plane_splitter = match self.context_3d {
             Picture3DContext::Out => {
                 None
             }
             Picture3DContext::In { root_data: Some(_), .. } => {
                 Some(PlaneSplitter::new())
@@ -4452,24 +4452,24 @@ impl PicturePrimitive {
         self.state.take().expect("bug: no state present!")
     }
 
     /// Add a primitive instance to the plane splitter. The function would generate
     /// an appropriate polygon, clip it against the frustum, and register with the
     /// given plane splitter.
     pub fn add_split_plane(
         splitter: &mut PlaneSplitter,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         prim_spatial_node_index: SpatialNodeIndex,
         original_local_rect: LayoutRect,
         combined_local_clip_rect: &LayoutRect,
         world_rect: WorldRect,
         plane_split_anchor: PlaneSplitAnchor,
     ) -> bool {
-        let transform = clip_scroll_tree
+        let transform = spatial_tree
             .get_world_transform(prim_spatial_node_index);
         let matrix = transform.clone().into_transform().cast();
 
         // Apply the local clip rect here, before splitting. This is
         // because the local clip rect can't be applied in the vertex
         // shader for split composites, since we are drawing polygons
         // rather that rectangles. The interpolation still works correctly
         // since we determine the UVs by doing a bilerp with a factor
@@ -4521,30 +4521,30 @@ impl PicturePrimitive {
 
         true
     }
 
     pub fn resolve_split_planes(
         &mut self,
         splitter: &mut PlaneSplitter,
         gpu_cache: &mut GpuCache,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) {
         let ordered = match self.context_3d {
             Picture3DContext::In { root_data: Some(ref mut list), .. } => list,
             _ => panic!("Expected to find 3D context root"),
         };
         ordered.clear();
 
         // Process the accumulated split planes and order them for rendering.
         // Z axis is directed at the screen, `sort` is ascending, and we need back-to-front order.
         for poly in splitter.sort(vec3(0.0, 0.0, 1.0)) {
             let cluster = &self.prim_list.clusters[poly.anchor.cluster_index];
             let spatial_node_index = cluster.spatial_node_index;
-            let transform = match clip_scroll_tree
+            let transform = match spatial_tree
                 .get_world_transform(spatial_node_index)
                 .inverse()
             {
                 Some(transform) => transform.into_transform(),
                 // logging this would be a bit too verbose
                 None => continue,
             };
 
@@ -4587,17 +4587,17 @@ impl PicturePrimitive {
         }
 
         // For out-of-preserve-3d pictures, the backface visibility is determined by
         // the local transform only.
         // Note: we aren't taking the transform relativce to the parent picture,
         // since picture tree can be more dense than the corresponding spatial tree.
         if !self.is_backface_visible {
             if let Picture3DContext::Out = self.context_3d {
-                match frame_context.clip_scroll_tree.get_local_visible_face(self.spatial_node_index) {
+                match frame_context.spatial_tree.get_local_visible_face(self.spatial_node_index) {
                     VisibleFace::Front => {}
                     VisibleFace::Back => return None,
                 }
             }
         }
 
         // Push information about this pic on stack for children to read.
         state.push_picture(PictureInfo {
@@ -4655,30 +4655,30 @@ impl PicturePrimitive {
             let has_svg_filter = if let PictureCompositeMode::SvgFilter(..) = composite_mode {
                 true
             } else {
                 false
             };
 
             // Check if there is perspective or if an SVG filter is applied, and thus whether a new
             // rasterization root should be established.
-            let establishes_raster_root = has_svg_filter || frame_context.clip_scroll_tree
+            let establishes_raster_root = has_svg_filter || frame_context.spatial_tree
                 .get_relative_transform(surface_spatial_node_index, parent_raster_node_index)
                 .is_perspective();
 
             let surface = SurfaceInfo::new(
                 surface_spatial_node_index,
                 if establishes_raster_root {
                     surface_spatial_node_index
                 } else {
                     parent_raster_node_index
                 },
                 inflation_factor,
                 frame_context.global_screen_world_rect,
-                &frame_context.clip_scroll_tree,
+                &frame_context.spatial_tree,
                 frame_context.global_device_pixel_scale,
             );
 
             self.raster_config = Some(RasterConfig {
                 composite_mode,
                 establishes_raster_root,
                 surface_index: state.push_surface(surface),
             });
@@ -4705,42 +4705,42 @@ impl PicturePrimitive {
         for cluster in &mut self.prim_list.clusters {
             cluster.flags.remove(ClusterFlags::IS_VISIBLE);
 
             // Skip the cluster if backface culled.
             if !cluster.flags.contains(ClusterFlags::IS_BACKFACE_VISIBLE) {
                 // For in-preserve-3d primitives and pictures, the backface visibility is
                 // evaluated relative to the containing block.
                 if let Picture3DContext::In { ancestor_index, .. } = self.context_3d {
-                    match frame_context.clip_scroll_tree
+                    match frame_context.spatial_tree
                         .get_relative_transform(cluster.spatial_node_index, ancestor_index)
                         .visible_face()
                     {
                         VisibleFace::Back => continue,
                         VisibleFace::Front => (),
                     }
                 }
             }
 
             // No point including this cluster if it can't be transformed
             let spatial_node = &frame_context
-                .clip_scroll_tree
+                .spatial_tree
                 .spatial_nodes[cluster.spatial_node_index.0 as usize];
             if !spatial_node.invertible {
                 continue;
             }
 
             // Update any primitives/cluster bounding rects that can only be done
             // with information available during frame building.
             if cluster.flags.contains(ClusterFlags::IS_BACKDROP_FILTER) {
                 let backdrop_to_world_mapper = SpaceMapper::new_with_target(
                     ROOT_SPATIAL_NODE_INDEX,
                     cluster.spatial_node_index,
                     LayoutRect::max_rect(),
-                    frame_context.clip_scroll_tree,
+                    frame_context.spatial_tree,
                 );
 
                 for prim_instance in &mut cluster.prim_instances {
                     match prim_instance.kind {
                         PrimitiveInstanceKind::Backdrop { data_handle, .. } => {
                             // The actual size and clip rect of this primitive are determined by computing the bounding
                             // box of the projected rect of the backdrop-filter element onto the backdrop.
                             let prim_data = &mut data_stores.backdrop[data_handle];
@@ -4751,17 +4751,17 @@ impl PicturePrimitive {
                             // Instead, we first project from the element to the world space and get a flattened 2D bounding rect
                             // in the screen space, we then map this rect from the world space to the backdrop space to get the
                             // proper bounding box where the backdrop-filter needs to be processed.
 
                             let prim_to_world_mapper = SpaceMapper::new_with_target(
                                 ROOT_SPATIAL_NODE_INDEX,
                                 spatial_node_index,
                                 LayoutRect::max_rect(),
-                                frame_context.clip_scroll_tree,
+                                frame_context.spatial_tree,
                             );
 
                             // First map to the screen and get a flattened rect
                             let prim_rect = prim_to_world_mapper.map(&prim_data.kind.border_rect).unwrap_or_else(LayoutRect::zero);
                             // Backwards project the flattened rect onto the backdrop
                             let prim_rect = backdrop_to_world_mapper.unmap(&prim_rect).unwrap_or_else(LayoutRect::zero);
 
                             // TODO(aosmond): Is this safe? Updating the primitive size during
@@ -4781,17 +4781,17 @@ impl PicturePrimitive {
                 }
             }
 
             // Map the cluster bounding rect into the space of the surface, and
             // include it in the surface bounding rect.
             let surface = state.current_surface_mut();
             surface.map_local_to_surface.set_target_spatial_node(
                 cluster.spatial_node_index,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
 
             // Mark the cluster visible, since it passed the invertible and
             // backface checks. In future, this will include spatial clustering
             // which will allow the frame building code to skip most of the
             // current per-primitive culling code.
             cluster.flags.insert(ClusterFlags::IS_VISIBLE);
             if let Some(cluster_rect) = surface.map_local_to_surface.map(&cluster.bounding_rect) {
@@ -4813,17 +4813,17 @@ impl PicturePrimitive {
                 // snapped primitive rects, which should result in a snapped
                 // local rect, unless it was inflated. This is also done during
                 // update visibility when calculating the picture's precise
                 // local rect.
                 let snap_surface_to_raster = SpaceSnapper::new_with_target(
                     surface.raster_spatial_node_index,
                     self.spatial_node_index,
                     surface.device_pixel_scale,
-                    frame_context.clip_scroll_tree,
+                    frame_context.spatial_tree,
                 );
 
                 surface.rect = snap_surface_to_raster.snap_rect(&surface.rect);
             }
 
             let mut surface_rect = surface.rect * Scale::new(1.0);
 
             // Pop this surface from the stack
@@ -4854,17 +4854,17 @@ impl PicturePrimitive {
                 }
                 _ => {}
             }
 
             // Propagate up to parent surface, now that we know this surface's static rect
             let parent_surface = state.current_surface_mut();
             parent_surface.map_local_to_surface.set_target_spatial_node(
                 self.spatial_node_index,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
             if let Some(parent_surface_rect) = parent_surface
                 .map_local_to_surface
                 .map(&surface_rect)
             {
                 parent_surface.rect = parent_surface.rect.union(&parent_surface_rect);
             }
         }
@@ -4877,17 +4877,17 @@ impl PicturePrimitive {
         data_stores: &mut DataStores,
     ) -> bool {
         let mut pic_state_for_children = self.take_state();
 
         if let Some(ref mut splitter) = pic_state_for_children.plane_splitter {
             self.resolve_split_planes(
                 splitter,
                 &mut frame_state.gpu_cache,
-                &frame_context.clip_scroll_tree,
+                &frame_context.spatial_tree,
             );
         }
 
         let raster_config = match self.raster_config {
             Some(ref mut raster_config) => raster_config,
             None => {
                 return true
             }
@@ -5050,53 +5050,53 @@ fn calculate_uv_rect_kind(
         bottom_right,
     }
 }
 
 fn create_raster_mappers(
     surface_spatial_node_index: SpatialNodeIndex,
     raster_spatial_node_index: SpatialNodeIndex,
     world_rect: WorldRect,
-    clip_scroll_tree: &ClipScrollTree,
+    spatial_tree: &SpatialTree,
 ) -> (SpaceMapper<RasterPixel, WorldPixel>, SpaceMapper<PicturePixel, RasterPixel>) {
     let map_raster_to_world = SpaceMapper::new_with_target(
         ROOT_SPATIAL_NODE_INDEX,
         raster_spatial_node_index,
         world_rect,
-        clip_scroll_tree,
+        spatial_tree,
     );
 
     let raster_bounds = map_raster_to_world.unmap(&world_rect)
                                            .unwrap_or_else(RasterRect::max_rect);
 
     let map_pic_to_raster = SpaceMapper::new_with_target(
         raster_spatial_node_index,
         surface_spatial_node_index,
         raster_bounds,
-        clip_scroll_tree,
+        spatial_tree,
     );
 
     (map_raster_to_world, map_pic_to_raster)
 }
 
 fn get_transform_key(
     spatial_node_index: SpatialNodeIndex,
     cache_spatial_node_index: SpatialNodeIndex,
-    clip_scroll_tree: &ClipScrollTree,
+    spatial_tree: &SpatialTree,
 ) -> TransformKey {
     // Note: this is the only place where we don't know beforehand if the tile-affecting
     // spatial node is below or above the current picture.
     let transform = if cache_spatial_node_index >= spatial_node_index {
-        clip_scroll_tree
+        spatial_tree
             .get_relative_transform(
                 cache_spatial_node_index,
                 spatial_node_index,
             )
     } else {
-        clip_scroll_tree
+        spatial_tree
             .get_relative_transform(
                 spatial_node_index,
                 cache_spatial_node_index,
             )
     };
     transform.into()
 }
 
--- a/gfx/wr/webrender/src/prim_store/backdrop.rs
+++ b/gfx/wr/webrender/src/prim_store/backdrop.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::PrimitiveFlags;
 use api::units::*;
-use crate::clip_scroll_tree::SpatialNodeIndex;
+use crate::spatial_tree::SpatialNodeIndex;
 use crate::intern::{Internable, InternDebug, Handle as InternHandle};
 use crate::internal_types::LayoutPrimitiveInfo;
 use crate::prim_store::{
     InternablePrimitive, PictureIndex, PrimitiveInstanceKind, PrimKey, PrimKeyCommonData, PrimTemplate,
     PrimTemplateCommonData, PrimitiveStore, PrimitiveSceneData, RectangleKey,
 };
 
 #[cfg_attr(feature = "capture", derive(Serialize))]
--- a/gfx/wr/webrender/src/prim_store/mod.rs
+++ b/gfx/wr/webrender/src/prim_store/mod.rs
@@ -6,17 +6,17 @@ use api::{BorderRadius, ClipMode, ColorF
 use api::{ImageRendering, RepeatMode, PrimitiveFlags};
 use api::{PremultipliedColorF, PropertyBinding, Shadow, GradientStop};
 use api::{BoxShadowClipMode, LineStyle, LineOrientation, BorderStyle};
 use api::{PrimitiveKeyKind};
 use api::units::*;
 use crate::border::{get_max_scale_for_border, build_border_instances};
 use crate::border::BorderSegmentCacheKey;
 use crate::clip::{ClipStore};
-use crate::clip_scroll_tree::{ROOT_SPATIAL_NODE_INDEX, ClipScrollTree, CoordinateSpaceMapping, SpatialNodeIndex, VisibleFace};
+use crate::spatial_tree::{ROOT_SPATIAL_NODE_INDEX, SpatialTree, CoordinateSpaceMapping, SpatialNodeIndex, VisibleFace};
 use crate::clip::{ClipDataStore, ClipNodeFlags, ClipChainId, ClipChainInstance, ClipItemKind};
 use crate::debug_colors;
 use crate::debug_render::DebugItem;
 use crate::scene_building::{CreateShadow, IsVisible};
 use euclid::{SideOffsets2D, Transform3D, Rect, Scale, Size2D, Point2D, Vector2D};
 use euclid::approxeq::ApproxEq;
 use crate::frame_builder::{FrameBuildingContext, FrameBuildingState, PictureContext, PictureState};
 use crate::frame_builder::{FrameVisibilityContext, FrameVisibilityState};
@@ -152,40 +152,40 @@ impl SpaceSnapper {
             device_pixel_scale,
         }
     }
 
     pub fn new_with_target(
         ref_spatial_node_index: SpatialNodeIndex,
         target_node_index: SpatialNodeIndex,
         device_pixel_scale: DevicePixelScale,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> Self {
         let mut snapper = SpaceSnapper {
             ref_spatial_node_index,
             current_target_spatial_node_index: SpatialNodeIndex::INVALID,
             snapping_transform: None,
             device_pixel_scale,
         };
 
-        snapper.set_target_spatial_node(target_node_index, clip_scroll_tree);
+        snapper.set_target_spatial_node(target_node_index, spatial_tree);
         snapper
     }
 
     pub fn set_target_spatial_node(
         &mut self,
         target_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) {
         if target_node_index == self.current_target_spatial_node_index {
             return
         }
 
-        let ref_spatial_node = &clip_scroll_tree.spatial_nodes[self.ref_spatial_node_index.0 as usize];
-        let target_spatial_node = &clip_scroll_tree.spatial_nodes[target_node_index.0 as usize];
+        let ref_spatial_node = &spatial_tree.spatial_nodes[self.ref_spatial_node_index.0 as usize];
+        let target_spatial_node = &spatial_tree.spatial_nodes[target_node_index.0 as usize];
 
         self.current_target_spatial_node_index = target_node_index;
         self.snapping_transform = match (ref_spatial_node.snapping_transform, target_spatial_node.snapping_transform) {
             (Some(ref ref_scale_offset), Some(ref target_scale_offset)) => {
                 Some(ref_scale_offset
                     .inverse()
                     .accumulate(target_scale_offset)
                     .scale(self.device_pixel_scale.0))
@@ -251,44 +251,44 @@ impl<F, T> SpaceMapper<F, T> where F: fm
             visible_face: VisibleFace::Front,
         }
     }
 
     pub fn new_with_target(
         ref_spatial_node_index: SpatialNodeIndex,
         target_node_index: SpatialNodeIndex,
         bounds: Rect<f32, T>,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> Self {
         let mut mapper = Self::new(ref_spatial_node_index, bounds);
-        mapper.set_target_spatial_node(target_node_index, clip_scroll_tree);
+        mapper.set_target_spatial_node(target_node_index, spatial_tree);
         mapper
     }
 
     pub fn set_target_spatial_node(
         &mut self,
         target_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) {
         if target_node_index == self.current_target_spatial_node_index {
             return
         }
 
-        let ref_spatial_node = &clip_scroll_tree.spatial_nodes[self.ref_spatial_node_index.0 as usize];
-        let target_spatial_node = &clip_scroll_tree.spatial_nodes[target_node_index.0 as usize];
+        let ref_spatial_node = &spatial_tree.spatial_nodes[self.ref_spatial_node_index.0 as usize];
+        let target_spatial_node = &spatial_tree.spatial_nodes[target_node_index.0 as usize];
 
         self.kind = if self.ref_spatial_node_index == target_node_index {
             CoordinateSpaceMapping::Local
         } else if ref_spatial_node.coordinate_system_id == target_spatial_node.coordinate_system_id {
             let scale_offset = ref_spatial_node.content_transform
                 .inverse()
                 .accumulate(&target_spatial_node.content_transform);
             CoordinateSpaceMapping::ScaleOffset(scale_offset)
         } else {
-            let transform = clip_scroll_tree
+            let transform = spatial_tree
                 .get_relative_transform(target_node_index, self.ref_spatial_node_index)
                 .into_transform()
                 .with_source::<F>()
                 .with_destination::<T>();
             CoordinateSpaceMapping::Transform(transform)
         };
 
         self.visible_face = self.kind.visible_face();
@@ -1927,17 +1927,17 @@ impl PrimitiveStore {
         let mut map_local_to_surface = surface
             .map_local_to_surface
             .clone();
 
         let map_surface_to_world = SpaceMapper::new_with_target(
             ROOT_SPATIAL_NODE_INDEX,
             surface.surface_spatial_node_index,
             frame_context.global_screen_world_rect,
-            frame_context.clip_scroll_tree,
+            frame_context.spatial_tree,
         );
 
         let mut surface_rect = PictureRect::zero();
 
         for cluster in &mut prim_list.clusters {
             // Get the cluster and see if is visible
             if !cluster.flags.contains(ClusterFlags::IS_VISIBLE) {
                 // Each prim instance must have reset called each frame, to clear
@@ -1955,17 +1955,17 @@ impl PrimitiveStore {
                 for prim_instance in &mut cluster.prim_instances {
                     prim_instance.reset();
                 }
                 continue;
             }
 
             map_local_to_surface.set_target_spatial_node(
                 cluster.spatial_node_index,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
 
             for prim_instance in &mut cluster.prim_instances {
                 prim_instance.reset();
 
                 if prim_instance.is_chased() {
                     #[cfg(debug_assertions)] // needed for ".id" part
                     println!("\tpreparing {:?} in {:?}", prim_instance.id, pic_index);
@@ -2102,43 +2102,43 @@ impl PrimitiveStore {
                         prim_instance.clip_chain_id,
                         frame_state.clip_store,
                     );
 
                     frame_state.clip_store.set_active_clips(
                         prim_instance.local_clip_rect,
                         cluster.spatial_node_index,
                         frame_state.clip_chain_stack.current_clips_array(),
-                        &frame_context.clip_scroll_tree,
+                        &frame_context.spatial_tree,
                         &mut frame_state.data_stores.clip,
                     );
 
                     let clip_chain = frame_state
                         .clip_store
                         .build_clip_chain_instance(
                             local_rect,
                             &map_local_to_surface,
                             &map_surface_to_world,
-                            &frame_context.clip_scroll_tree,
+                            &frame_context.spatial_tree,
                             frame_state.gpu_cache,
                             frame_state.resource_cache,
                             surface.device_pixel_scale,
                             &world_culling_rect,
                             &mut frame_state.data_stores.clip,
                             true,
                             prim_instance.is_chased(),
                         );
 
                     if let Some(ref mut tile_cache) = frame_state.tile_cache {
                         if !tile_cache.update_prim_dependencies(
                             prim_instance,
                             cluster.spatial_node_index,
                             clip_chain.as_ref(),
                             prim_local_rect,
-                            frame_context.clip_scroll_tree,
+                            frame_context.spatial_tree,
                             frame_state.data_stores,
                             frame_state.clip_store,
                             &self.pictures,
                             frame_state.resource_cache,
                             &self.opacity_bindings,
                             &self.images,
                             surface_index,
                             surface.surface_spatial_node_index,
@@ -2313,17 +2313,17 @@ impl PrimitiveStore {
                 // snapped primitive rects, which should result in a snapped
                 // local rect, unless it was inflated. This is also done during
                 // surface configuration when calculating the picture's
                 // estimated local rect.
                 let snap_pic_to_raster = SpaceSnapper::new_with_target(
                     surface.raster_spatial_node_index,
                     pic.spatial_node_index,
                     surface.device_pixel_scale,
-                    frame_context.clip_scroll_tree,
+                    frame_context.spatial_tree,
                 );
                 surface_rect = rc.composite_mode.inflate_picture_rect(surface_rect, surface.inflation_factor);
                 surface_rect = snap_pic_to_raster.snap_rect(&surface_rect);
             }
 
             // Layout space for the picture is picture space from the
             // perspective of its child primitives.
             let pic_local_rect = surface_rect * Scale::new(1.0);
@@ -2356,17 +2356,17 @@ impl PrimitiveStore {
 
             None
         } else {
             let parent_surface = &frame_context.surfaces[parent_surface_index.0 as usize];
             let map_surface_to_parent_surface = SpaceMapper::new_with_target(
                 parent_surface.surface_spatial_node_index,
                 surface.surface_spatial_node_index,
                 PictureRect::max_rect(),
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
             map_surface_to_parent_surface.map(&surface_rect)
         }
     }
 
     fn request_resources_for_prim(
         &mut self,
         prim_instance: &mut PrimitiveInstance,
@@ -2426,17 +2426,17 @@ impl PrimitiveStore {
                             .combined_local_clip_rect
                             .intersection(&prim_rect).unwrap();
                         image_instance.tight_local_clip_rect = tight_clip_rect;
 
                         let map_local_to_world = SpaceMapper::new_with_target(
                             ROOT_SPATIAL_NODE_INDEX,
                             prim_spatial_node_index,
                             frame_context.global_screen_world_rect,
-                            frame_context.clip_scroll_tree,
+                            frame_context.spatial_tree,
                         );
 
                         let visible_rect = compute_conservative_visible_rect(
                             &tight_clip_rect,
                             prim_world_rect,
                             &map_local_to_world,
                         );
 
@@ -2791,17 +2791,17 @@ impl PrimitiveStore {
         frame_state: &mut FrameBuildingState,
         data_stores: &mut DataStores,
         scratch: &mut PrimitiveScratchBuffer,
         tile_cache_log: &mut TileCacheLogger,
     ) {
         for (cluster_index, cluster) in prim_list.clusters.iter_mut().enumerate() {
             pic_state.map_local_to_pic.set_target_spatial_node(
                 cluster.spatial_node_index,
-                frame_context.clip_scroll_tree,
+                frame_context.spatial_tree,
             );
 
             for (prim_instance_index, prim_instance) in cluster.prim_instances.iter_mut().enumerate() {
                 if prim_instance.visibility_info == PrimitiveVisibilityIndex::INVALID {
                     continue;
                 }
 
                 // The original clipped world rect was calculated during the initial visibility pass.
@@ -2915,41 +2915,41 @@ impl PrimitiveStore {
             PrimitiveInstanceKind::TextRun { run_index, data_handle, .. } => {
                 let prim_data = &mut data_stores.text_run[*data_handle];
                 let run = &mut self.text_runs[*run_index];
 
                 prim_data.common.may_need_repetition = false;
 
                 // The glyph transform has to match `glyph_transform` in "ps_text_run" shader.
                 // It's relative to the rasterizing space of a glyph.
-                let transform = frame_context.clip_scroll_tree
+                let transform = frame_context.spatial_tree
                     .get_relative_transform(
                         prim_spatial_node_index,
                         pic_context.raster_spatial_node_index,
                     )
                     .into_fast_transform();
                 let prim_offset = prim_instance.prim_origin.to_vector() - run.reference_frame_relative_offset;
 
                 let pic = &self.pictures[pic_context.pic_index.0];
-                let raster_space = pic.get_raster_space(frame_context.clip_scroll_tree);
+                let raster_space = pic.get_raster_space(frame_context.spatial_tree);
                 let surface = &frame_state.surfaces[pic_context.surface_index.0];
 
                 run.request_resources(
                     prim_offset,
                     &prim_data.font,
                     &prim_data.glyphs,
                     &transform.to_transform().with_destination::<_>(),
                     surface,
                     prim_spatial_node_index,
                     raster_space,
                     pic_context.subpixel_mode,
                     frame_state.resource_cache,
                     frame_state.gpu_cache,
                     frame_state.render_tasks,
-                    frame_context.clip_scroll_tree,
+                    frame_context.spatial_tree,
                     scratch,
                 );
 
                 // Update the template this instane references, which may refresh the GPU
                 // cache with any shared template data.
                 prim_data.update(frame_state);
             }
             PrimitiveInstanceKind::Clear { data_handle, .. } => {
@@ -2977,17 +2977,17 @@ impl PrimitiveStore {
                 // cache with any shared template data.
                 border_data.update(common_data, frame_state);
 
                 // TODO(gw): For now, the scale factors to rasterize borders at are
                 //           based on the true world transform of the primitive. When
                 //           raster roots with local scale are supported in future,
                 //           that will need to be accounted for here.
                 let scale = frame_context
-                    .clip_scroll_tree
+                    .spatial_tree
                     .get_world_transform(prim_spatial_node_index)
                     .scale_factors();
 
                 // Scale factors are normalized to a power of 2 to reduce the number of
                 // resolution changes.
                 // For frames with a changing scale transform round scale factors up to
                 // nearest power-of-2 boundary so that we don't keep having to redraw
                 // the content as it scales up and down. Rounding up to nearest
@@ -3223,17 +3223,17 @@ impl PrimitiveStore {
                         prim_instance.prim_origin,
                         prim_data.common.prim_size,
                     );
 
                     let map_local_to_world = SpaceMapper::new_with_target(
                         ROOT_SPATIAL_NODE_INDEX,
                         prim_spatial_node_index,
                         frame_context.global_screen_world_rect,
-                        frame_context.clip_scroll_tree,
+                        frame_context.spatial_tree,
                     );
 
                     gradient.visible_tiles_range = decompose_repeated_primitive(
                         &prim_info.combined_local_clip_rect,
                         &prim_rect,
                         prim_info.clipped_world_rect,
                         &prim_data.stretch_size,
                         &prim_data.tile_spacing,
@@ -3285,17 +3285,17 @@ impl PrimitiveStore {
                         prim_instance.prim_origin,
                         prim_data.common.prim_size,
                     );
 
                     let map_local_to_world = SpaceMapper::new_with_target(
                         ROOT_SPATIAL_NODE_INDEX,
                         prim_spatial_node_index,
                         frame_context.global_screen_world_rect,
-                        frame_context.clip_scroll_tree,
+                        frame_context.spatial_tree,
                     );
 
                     prim_data.common.may_need_repetition = false;
 
                     *visible_tiles_range = decompose_repeated_primitive(
                         &prim_info.combined_local_clip_rect,
                         &prim_rect,
                         prim_info.clipped_world_rect,
@@ -3337,17 +3337,17 @@ impl PrimitiveStore {
                 if pic.prepare_for_render(
                     frame_context,
                     frame_state,
                     data_stores,
                 ) {
                     if let Some(ref mut splitter) = pic_state.plane_splitter {
                         PicturePrimitive::add_split_plane(
                             splitter,
-                            frame_context.clip_scroll_tree,
+                            frame_context.spatial_tree,
                             prim_spatial_node_index,
                             pic.precise_local_rect,
                             &prim_info.combined_local_clip_rect,
                             frame_state.current_dirty_region().combined,
                             plane_split_anchor,
                         );
                     }
 
@@ -3902,27 +3902,27 @@ impl PrimitiveInstance {
 
             for segment in segments {
                 // Build a clip chain for the smaller segment rect. This will
                 // often manage to eliminate most/all clips, and sometimes
                 // clip the segment completely.
                 frame_state.clip_store.set_active_clips_from_clip_chain(
                     &prim_info.clip_chain,
                     prim_spatial_node_index,
-                    &frame_context.clip_scroll_tree,
+                    &frame_context.spatial_tree,
                     &data_stores.clip,
                 );
 
                 let segment_clip_chain = frame_state
                     .clip_store
                     .build_clip_chain_instance(
                         segment.local_rect.translate(self.prim_origin.to_vector()),
                         &pic_state.map_local_to_pic,
                         &pic_state.map_pic_to_world,
-                        &frame_context.clip_scroll_tree,
+                        &frame_context.spatial_tree,
                         frame_state.gpu_cache,
                         frame_state.resource_cache,
                         device_pixel_scale,
                         &dirty_world_rect,
                         &mut data_stores.clip,
                         false,
                         self.is_chased(),
                     );
--- a/gfx/wr/webrender/src/prim_store/text_run.rs
+++ b/gfx/wr/webrender/src/prim_store/text_run.rs
@@ -13,17 +13,17 @@ use crate::internal_types::LayoutPrimiti
 use crate::picture::{SubpixelMode, SurfaceInfo};
 use crate::prim_store::{PrimitiveOpacity, PrimitiveSceneData,  PrimitiveScratchBuffer};
 use crate::prim_store::{PrimitiveStore, PrimKeyCommonData, PrimTemplateCommonData};
 use crate::render_task_graph::RenderTaskGraph;
 use crate::renderer::{MAX_VERTEX_TEXTURE_WIDTH};
 use crate::resource_cache::{ResourceCache};
 use crate::util::{MatrixHelpers};
 use crate::prim_store::{InternablePrimitive, PrimitiveInstanceKind, SpaceSnapper};
-use crate::clip_scroll_tree::{ClipScrollTree, SpatialNodeIndex};
+use crate::spatial_tree::{SpatialTree, SpatialNodeIndex};
 use std::ops;
 use std::sync::Arc;
 use crate::storage;
 use crate::util::PrimaryArc;
 
 /// A run of glyphs, with associated font information.
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
@@ -223,17 +223,17 @@ impl TextRunPrimitive {
     pub fn update_font_instance(
         &mut self,
         specified_font: &FontInstance,
         surface: &SurfaceInfo,
         spatial_node_index: SpatialNodeIndex,
         transform: &LayoutToWorldTransform,
         subpixel_mode: SubpixelMode,
         raster_space: RasterSpace,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> bool {
         // If local raster space is specified, include that in the scale
         // of the glyphs that get rasterized.
         // TODO(gw): Once we support proper local space raster modes, this
         //           will implicitly be part of the device pixel ratio for
         //           the (cached) local space surface, and so this code
         //           will no longer be required.
         let mut raster_space = raster_space;
@@ -287,17 +287,17 @@ impl TextRunPrimitive {
             self.reference_frame_relative_offset
         } else {
             // There may be an animation, so snap the reference frame relative
             // offset such that it excludes the impact, if any.
             let snap_to_device = SpaceSnapper::new_with_target(
                 surface.raster_spatial_node_index,
                 spatial_node_index,
                 surface.device_pixel_scale,
-                clip_scroll_tree,
+                spatial_tree,
             );
             snap_to_device.snap_vector(&self.reference_frame_relative_offset)
         };
 
         // If the transform or device size is different, then the caller of
         // this method needs to know to rebuild the glyphs.
         let cache_dirty =
             self.used_font.transform != font_transform ||
@@ -340,27 +340,27 @@ impl TextRunPrimitive {
         transform: &LayoutToWorldTransform,
         surface: &SurfaceInfo,
         spatial_node_index: SpatialNodeIndex,
         raster_space: RasterSpace,
         subpixel_mode: SubpixelMode,
         resource_cache: &mut ResourceCache,
         gpu_cache: &mut GpuCache,
         render_tasks: &mut RenderTaskGraph,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         scratch: &mut PrimitiveScratchBuffer,
     ) {
         let cache_dirty = self.update_font_instance(
             specified_font,
             surface,
             spatial_node_index,
             transform,
             subpixel_mode,
             raster_space,
-            clip_scroll_tree,
+            spatial_tree,
         );
 
         if self.glyph_keys_range.is_empty() || cache_dirty {
             let subpx_dir = self.used_font.get_subpx_dir();
 
             self.glyph_keys_range = scratch.glyph_keys.extend(
                 glyphs.iter().map(|src| {
                     let src_point = src.point + prim_offset;
--- a/gfx/wr/webrender/src/render_backend.rs
+++ b/gfx/wr/webrender/src/render_backend.rs
@@ -15,17 +15,17 @@ use api::{ScrollLocation, TransactionMsg
 use api::{NotificationRequest, Checkpoint, QualitySettings};
 use api::{ClipIntern, FilterDataIntern, PrimitiveKeyKind};
 use api::units::*;
 use api::channel::{MsgReceiver, MsgSender, Payload};
 #[cfg(feature = "capture")]
 use api::CaptureBits;
 #[cfg(feature = "replay")]
 use api::CapturedDocument;
-use crate::clip_scroll_tree::SpatialNodeIndex;
+use crate::spatial_tree::SpatialNodeIndex;
 use crate::composite::{CompositorKind, CompositeDescriptor};
 #[cfg(feature = "debugger")]
 use crate::debug_server;
 use crate::frame_builder::{FrameBuilder, FrameBuilderConfig};
 use crate::glyph_rasterizer::{FontInstance};
 use crate::gpu_cache::GpuCache;
 use crate::hit_test::{HitTest, HitTester};
 use crate::intern::DataStore;
@@ -500,32 +500,32 @@ impl Document {
 
                 return DocumentOps {
                     scroll: true,
                     ..DocumentOps::nop()
                 };
             }
             FrameMsg::GetScrollNodeState(tx) => {
                 profile_scope!("GetScrollNodeState");
-                tx.send(self.scene.clip_scroll_tree.get_scroll_node_state()).unwrap();
+                tx.send(self.scene.spatial_tree.get_scroll_node_state()).unwrap();
             }
             FrameMsg::UpdateDynamicProperties(property_bindings) => {
                 self.dynamic_properties.set_properties(property_bindings);
             }
             FrameMsg::AppendDynamicProperties(property_bindings) => {
                 self.dynamic_properties.add_properties(property_bindings);
             }
             FrameMsg::SetPinchZoom(factor) => {
                 if self.view.pinch_zoom_factor != factor.get() {
                     self.view.pinch_zoom_factor = factor.get();
                     self.frame_is_valid = false;
                 }
             }
             FrameMsg::SetIsTransformAsyncZooming(is_zooming, animation_id) => {
-                let node = self.scene.clip_scroll_tree.spatial_nodes.iter_mut()
+                let node = self.scene.spatial_tree.spatial_nodes.iter_mut()
                     .find(|node| node.is_transform_bound_to_property(animation_id));
                 if let Some(node) = node {
                     if node.is_async_zooming != is_zooming {
                         node.is_async_zooming = is_zooming;
                         self.frame_is_valid = false;
                     }
                 }
             }
@@ -586,17 +586,17 @@ impl Document {
             is_new_scene,
         }
     }
 
     fn rebuild_hit_tester(&mut self) {
         let accumulated_scale_factor = self.view.accumulated_scale_factor();
         let pan = self.view.pan.to_f32() / accumulated_scale_factor;
 
-            self.scene.clip_scroll_tree.update_tree(
+            self.scene.spatial_tree.update_tree(
                 pan,
                 accumulated_scale_factor,
                 &self.dynamic_properties,
             );
 
         self.hit_tester = Some(self.scene.create_hit_tester(&self.data_stores.clip));
         self.hit_tester_is_valid = true;
     }
@@ -606,37 +606,37 @@ impl Document {
         PipelineInfo {
             epochs: self.scene.pipeline_epochs.iter()
                 .map(|(&pipeline_id, &epoch)| ((pipeline_id, self.id), epoch)).collect(),
             removed_pipelines,
         }
     }
 
     pub fn discard_frame_state_for_pipeline(&mut self, pipeline_id: PipelineId) {
-        self.scene.clip_scroll_tree
+        self.scene.spatial_tree
             .discard_frame_state_for_pipeline(pipeline_id);
     }
 
     /// Returns true if any nodes actually changed position or false otherwise.
     pub fn scroll_nearest_scrolling_ancestor(
         &mut self,
         scroll_location: ScrollLocation,
         scroll_node_index: Option<SpatialNodeIndex>,
     ) -> bool {
-        self.scene.clip_scroll_tree.scroll_nearest_scrolling_ancestor(scroll_location, scroll_node_index)
+        self.scene.spatial_tree.scroll_nearest_scrolling_ancestor(scroll_location, scroll_node_index)
     }
 
     /// Returns true if the node actually changed position or false otherwise.
     pub fn scroll_node(
         &mut self,
         origin: LayoutPoint,
         id: ExternalScrollId,
         clamp: ScrollClamping
     ) -> bool {
-        self.scene.clip_scroll_tree.scroll_node(origin, id, clamp)
+        self.scene.spatial_tree.scroll_node(origin, id, clamp)
     }
 
     pub fn new_async_scene_ready(
         &mut self,
         built_scene: BuiltScene,
         recycler: &mut Recycler,
     ) {
         self.frame_is_valid = false;
@@ -646,27 +646,27 @@ impl Document {
         // Right now, all this does is build a hash map of any cached
         // surface tiles, that can be provided to the next scene.
         // TODO(nical) - It's a bit awkward how these retained tiles live
         // in the scene's prim store then temporarily in the frame builder
         // and then presumably back in the prim store during the next frame
         // build.
         let mut retained_tiles = RetainedTiles::new();
         self.scene.prim_store.destroy(&mut retained_tiles);
-        let old_scrolling_states = self.scene.clip_scroll_tree.drain();
+        let old_scrolling_states = self.scene.spatial_tree.drain();
 
         self.scene = built_scene;
 
         // Provide any cached tiles from the previous scene to
         // the newly built one.
         self.frame_builder.set_retained_resources(retained_tiles);
 
         self.scratch.recycle(recycler);
 
-        self.scene.clip_scroll_tree.finalize_and_apply_pending_scroll_offsets(old_scrolling_states);
+        self.scene.spatial_tree.finalize_and_apply_pending_scroll_offsets(old_scrolling_states);
     }
 }
 
 struct DocumentOps {
     scroll: bool,
 }
 
 impl DocumentOps {
@@ -1153,17 +1153,17 @@ impl RenderBackend {
                     }
                     DebugCommand::FetchDocuments => {
                         // Ask SceneBuilderThread to send JSON presentation of the documents,
                         // that will be forwarded to Renderer.
                         self.scene_tx.send(SceneBuilderRequest::DocumentsForDebugger).unwrap();
                         return RenderBackendStatus::Continue;
                     }
                     DebugCommand::FetchClipScrollTree => {
-                        let json = self.get_clip_scroll_tree_for_debugger();
+                        let json = self.get_spatial_tree_for_debugger();
                         ResultMsg::DebugOutput(DebugOutput::FetchClipScrollTree(json))
                     }
                     #[cfg(feature = "capture")]
                     DebugCommand::SaveCapture(root, bits) => {
                         let output = self.save_capture(root, bits, profile_counters);
                         ResultMsg::DebugOutput(output)
                     },
                     #[cfg(feature = "replay")]
@@ -1653,31 +1653,31 @@ impl RenderBackend {
         }
 
         if !doc.hit_tester_is_valid {
             doc.rebuild_hit_tester();
         }
     }
 
     #[cfg(not(feature = "debugger"))]
-    fn get_clip_scroll_tree_for_debugger(&self) -> String {
+    fn get_spatial_tree_for_debugger(&self) -> String {
         String::new()
     }
 
     #[cfg(feature = "debugger")]
-    fn get_clip_scroll_tree_for_debugger(&self) -> String {
+    fn get_spatial_tree_for_debugger(&self) -> String {
         use crate::print_tree::PrintableTree;
 
-        let mut debug_root = debug_server::ClipScrollTreeList::new();
+        let mut debug_root = debug_server::SpatialTreeList::new();
 
         for (_, doc) in &self.documents {
-            let debug_node = debug_server::TreeNode::new("document clip-scroll tree");
+            let debug_node = debug_server::TreeNode::new("document spatial tree");
             let mut builder = debug_server::TreeNodeBuilder::new(debug_node);
 
-            doc.scene.clip_scroll_tree.print_with(&mut builder);
+            doc.scene.spatial_tree.print_with(&mut builder);
 
             debug_root.add(builder.build());
         }
 
         serde_json::to_string(&debug_root).unwrap()
     }
 
     fn report_memory(&mut self, tx: MsgSender<Box<MemoryReport>>) {
@@ -1762,18 +1762,18 @@ impl RenderBackend {
                 // they are applied on the `Renderer` side.
                 let msg_update_gpu_cache = ResultMsg::UpdateGpuCache(self.gpu_cache.extract_updates());
                 self.result_tx.send(msg_update_gpu_cache).unwrap();
                 //TODO: write down doc's pipeline info?
                 // it has `pipeline_epoch_map`,
                 // which may capture necessary details for some cases.
                 let file_name = format!("frame-{}-{}", id.namespace_id.0, id.id);
                 config.serialize(&rendered_document.frame, file_name);
-                let file_name = format!("clip-scroll-{}-{}", id.namespace_id.0, id.id);
-                config.serialize_tree(&doc.scene.clip_scroll_tree, file_name);
+                let file_name = format!("spatial-{}-{}", id.namespace_id.0, id.id);
+                config.serialize_tree(&doc.scene.spatial_tree, file_name);
                 let file_name = format!("builder-{}-{}", id.namespace_id.0, id.id);
                 config.serialize(&doc.frame_builder, file_name);
                 let file_name = format!("scratch-{}-{}", id.namespace_id.0, id.id);
                 config.serialize(&doc.scratch, file_name);
                 let file_name = format!("properties-{}-{}", id.namespace_id.0, id.id);
                 config.serialize(&doc.dynamic_properties, file_name);
                 let file_name = format!("render-tasks-{}-{}.svg", id.namespace_id.0, id.id);
                 let mut svg_file = fs::File::create(&config.file_path(file_name, "svg"))
--- a/gfx/wr/webrender/src/render_target.rs
+++ b/gfx/wr/webrender/src/render_target.rs
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 use api::units::*;
 use api::{ColorF, PremultipliedColorF, ImageFormat, LineOrientation, BorderStyle, PipelineId};
 use crate::batch::{AlphaBatchBuilder, AlphaBatchContainer, BatchTextures, resolve_image};
 use crate::batch::{ClipBatcher, BatchBuilder};
-use crate::clip_scroll_tree::{ClipScrollTree, ROOT_SPATIAL_NODE_INDEX};
+use crate::spatial_tree::{SpatialTree, ROOT_SPATIAL_NODE_INDEX};
 use crate::clip::ClipStore;
 use crate::composite::CompositeState;
 use crate::device::Texture;
 use crate::frame_builder::{FrameGlobalResources};
 use crate::gpu_cache::{GpuCache, GpuCacheAddress};
 use crate::gpu_types::{BorderInstance, SvgFilterInstance, BlurDirection, BlurInstance, PrimitiveHeaders, ScalingInstance};
 use crate::gpu_types::{TransformPalette, ZBufferIdGenerator};
 use crate::internal_types::{FastHashMap, TextureSource, LayerIndex, Swizzle, SavedTargetIndex};
@@ -58,17 +58,17 @@ pub struct RenderTargetIndex(pub usize);
 pub struct RenderTargetContext<'a, 'rc> {
     pub global_device_pixel_scale: DevicePixelScale,
     pub prim_store: &'a PrimitiveStore,
     pub resource_cache: &'rc mut ResourceCache,
     pub use_dual_source_blending: bool,
     pub use_advanced_blending: bool,
     pub break_advanced_blend_batches: bool,
     pub batch_lookback_count: usize,
-    pub clip_scroll_tree: &'a ClipScrollTree,
+    pub spatial_tree: &'a SpatialTree,
     pub data_stores: &'a DataStores,
     pub surfaces: &'a [SurfaceInfo],
     pub scratch: &'a PrimitiveScratchBuffer,
     pub screen_world_rect: WorldRect,
     pub globals: &'a FrameGlobalResources,
 }
 
 /// Represents a number of rendering operations on a surface.
@@ -658,17 +658,17 @@ impl RenderTarget for AlphaRenderTarget 
             }
             RenderTaskKind::CacheMask(ref task_info) => {
                 self.clip_batcher.add(
                     task_info.clip_node_range,
                     task_info.root_spatial_node_index,
                     ctx.resource_cache,
                     gpu_cache,
                     clip_store,
-                    ctx.clip_scroll_tree,
+                    ctx.spatial_tree,
                     transforms,
                     &ctx.data_stores.clip,
                     task_info.actual_rect,
                     &ctx.screen_world_rect,
                     task_info.device_pixel_scale,
                     target_rect.origin.to_f32(),
                     task_info.actual_rect.origin.to_f32(),
                 );
--- a/gfx/wr/webrender/src/render_task.rs
+++ b/gfx/wr/webrender/src/render_task.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{CompositeOperator, FilterPrimitive, FilterPrimitiveInput, FilterPrimitiveKind};
 use api::{LineStyle, LineOrientation, ClipMode, MixBlendMode, ColorF, ColorSpace};
 use api::units::*;
 use crate::clip::{ClipDataStore, ClipItemKind, ClipStore, ClipNodeRange, ClipNodeFlags};
-use crate::clip_scroll_tree::SpatialNodeIndex;
+use crate::spatial_tree::SpatialNodeIndex;
 use crate::filterdata::SFilterData;
 use crate::frame_builder::FrameBuilderConfig;
 use crate::gpu_cache::{GpuCache, GpuCacheAddress, GpuCacheHandle};
 use crate::gpu_types::{BorderInstance, ImageSource, UvRectKind};
 use crate::internal_types::{CacheTextureId, FastHashMap, LayerIndex, SavedTargetIndex};
 use crate::picture::ResolvedSurfaceTexture;
 use crate::prim_store::{PictureIndex, PrimitiveVisibilityMask};
 use crate::prim_store::image::ImageCacheKey;
--- a/gfx/wr/webrender/src/scene.rs
+++ b/gfx/wr/webrender/src/scene.rs
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{BuiltDisplayList, DisplayItemCache, ColorF, DynamicProperties, Epoch, FontRenderMode};
 use api::{PipelineId, PropertyBinding, PropertyBindingId, MixBlendMode, StackingContext};
 use api::units::*;
 use crate::composite::CompositorKind;
 use crate::clip::{ClipStore, ClipDataStore};
-use crate::clip_scroll_tree::{ClipScrollTree, SpatialNodeIndex};
+use crate::spatial_tree::{SpatialTree, SpatialNodeIndex};
 use crate::frame_builder::{ChasePrimitive, FrameBuilderConfig};
 use crate::hit_test::{HitTester, HitTestingScene, HitTestingSceneStats};
 use crate::internal_types::{FastHashMap, FastHashSet};
 use crate::prim_store::{PrimitiveStore, PrimitiveStoreStats, PictureIndex};
 use std::sync::Arc;
 
 /// Stores a map of the animated property bindings for the current display list. These
 /// can be used to animate the transform and/or opacity of a display list without
@@ -229,33 +229,33 @@ pub struct BuiltScene {
     pub has_root_pipeline: bool,
     pub pipeline_epochs: FastHashMap<PipelineId, Epoch>,
     pub output_rect: DeviceIntRect,
     pub background_color: Option<ColorF>,
     pub root_pic_index: PictureIndex,
     pub prim_store: PrimitiveStore,
     pub clip_store: ClipStore,
     pub config: FrameBuilderConfig,
-    pub clip_scroll_tree: ClipScrollTree,
+    pub spatial_tree: SpatialTree,
     pub hit_testing_scene: Arc<HitTestingScene>,
     pub content_slice_count: usize,
     pub picture_cache_spatial_nodes: FastHashSet<SpatialNodeIndex>,
 }
 
 impl BuiltScene {
     pub fn empty() -> Self {
         BuiltScene {
             has_root_pipeline: false,
             pipeline_epochs: FastHashMap::default(),
             output_rect: DeviceIntRect::zero(),
             background_color: None,
             root_pic_index: PictureIndex(0),
             prim_store: PrimitiveStore::new(&PrimitiveStoreStats::empty()),
             clip_store: ClipStore::new(),
-            clip_scroll_tree: ClipScrollTree::new(),
+            spatial_tree: SpatialTree::new(),
             hit_testing_scene: Arc::new(HitTestingScene::new(&HitTestingSceneStats::empty())),
             content_slice_count: 0,
             picture_cache_spatial_nodes: FastHashSet::default(),
             config: FrameBuilderConfig {
                 default_font_render_mode: FontRenderMode::Mono,
                 dual_source_blending_is_enabled: true,
                 dual_source_blending_is_supported: false,
                 chase_primitive: ChasePrimitive::Nothing,
@@ -281,17 +281,17 @@ impl BuiltScene {
     }
 
     pub fn create_hit_tester(
         &mut self,
         clip_data_store: &ClipDataStore,
     ) -> HitTester {
         HitTester::new(
             Arc::clone(&self.hit_testing_scene),
-            &self.clip_scroll_tree,
+            &self.spatial_tree,
             &self.clip_store,
             clip_data_store,
         )
     }
 }
 
 /// Stores the allocation sizes of various arrays in the built
 /// scene. This is retrieved from the current frame builder
--- a/gfx/wr/webrender/src/scene_building.rs
+++ b/gfx/wr/webrender/src/scene_building.rs
@@ -9,17 +9,17 @@ use api::{FilterOp, FilterPrimitive, Fon
 use api::{IframeDisplayItem, ImageKey, ImageRendering, ItemRange, ColorDepth, QualitySettings};
 use api::{LineOrientation, LineStyle, NinePatchBorderSource, PipelineId, MixBlendMode};
 use api::{PropertyBinding, ReferenceFrame, ReferenceFrameKind, ScrollFrameDisplayItem, ScrollSensitivity};
 use api::{Shadow, SpaceAndClipInfo, SpatialId, StackingContext, StickyFrameDisplayItem};
 use api::{ClipMode, PrimitiveKeyKind, TransformStyle, YuvColorSpace, ColorRange, YuvData, TempFilterData};
 use api::units::*;
 use crate::clip::{ClipChainId, ClipRegion, ClipItemKey, ClipStore, ClipItemKeyKind};
 use crate::clip::{ClipInternData, ClipDataHandle, ClipNodeKind};
-use crate::clip_scroll_tree::{ROOT_SPATIAL_NODE_INDEX, ClipScrollTree, SpatialNodeIndex};
+use crate::spatial_tree::{ROOT_SPATIAL_NODE_INDEX, SpatialTree, SpatialNodeIndex};
 use crate::frame_builder::{ChasePrimitive, FrameBuilderConfig};
 use crate::glyph_rasterizer::FontInstance;
 use crate::hit_test::{HitTestingItem, HitTestingScene};
 use crate::image::simplify_repeated_primitive;
 use crate::intern::Interner;
 use crate::internal_types::{FastHashMap, FastHashSet, LayoutPrimitiveInfo, Filter};
 use crate::picture::{Picture3DContext, PictureCompositeMode, PicturePrimitive, PictureOptions};
 use crate::picture::{BlitReason, OrderedPictureChild, PrimitiveList, TileCacheInstance, ClusterFlags};
@@ -148,33 +148,33 @@ impl ScrollOffsetMapper {
         ScrollOffsetMapper {
             current_spatial_node: SpatialNodeIndex::INVALID,
             current_offset: LayoutVector2D::zero(),
         }
     }
 
     /// Return the accumulated external scroll offset for a spatial
     /// node. This caches the last result, which is the common case,
-    /// or defers to the clip scroll tree to build the value.
+    /// or defers to the spatial tree to build the value.
     fn external_scroll_offset(
         &mut self,
         spatial_node_index: SpatialNodeIndex,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
     ) -> LayoutVector2D {
         if spatial_node_index != self.current_spatial_node {
             self.current_spatial_node = spatial_node_index;
-            self.current_offset = clip_scroll_tree.external_scroll_offset(spatial_node_index);
+            self.current_offset = spatial_tree.external_scroll_offset(spatial_node_index);
         }
 
         self.current_offset
     }
 }
 
 /// A data structure that keeps track of mapping between API Ids for clips/spatials and the indices
-/// used internally in the ClipScrollTree to avoid having to do HashMap lookups. NodeIdToIndexMapper
+/// used internally in the SpatialTree to avoid having to do HashMap lookups. NodeIdToIndexMapper
 /// is responsible for mapping both ClipId to ClipChainIndex and SpatialId to SpatialNodeIndex.
 #[derive(Default)]
 pub struct NodeIdToIndexMapper {
     clip_node_map: FastHashMap<ClipId, ClipNode>,
     spatial_node_map: FastHashMap<SpatialId, SpatialNodeIndex>,
 }
 
 impl NodeIdToIndexMapper {
@@ -306,30 +306,30 @@ pub struct SceneBuilder<'a> {
     /// The map of all font instances.
     font_instances: FontInstanceMap,
 
     /// A set of pipelines that the caller has requested be made available as
     /// output textures.
     output_pipelines: &'a FastHashSet<PipelineId>,
 
     /// The data structure that converts between ClipId/SpatialId and the various
-    /// index types that the ClipScrollTree uses.
+    /// index types that the SpatialTree uses.
     id_to_index_mapper: NodeIdToIndexMapper,
 
     /// A stack of stacking context properties.
     sc_stack: Vec<FlattenedStackingContext>,
 
     /// Maintains state for any currently active shadows
     pending_shadow_items: VecDeque<ShadowItem>,
 
     /// The stack keeping track of the root clip chains associated with pipelines.
     pipeline_clip_chain_stack: Vec<ClipChainId>,
 
-    /// The ClipScrollTree that we are currently building during building.
-    pub clip_scroll_tree: ClipScrollTree,
+    /// The SpatialTree that we are currently building during building.
+    pub spatial_tree: SpatialTree,
 
     /// The store of primitives.
     pub prim_store: PrimitiveStore,
 
     /// Information about all primitives involved in hit testing.
     pub hit_testing_scene: HitTestingScene,
 
     /// The store which holds all complex clipping information.
@@ -389,17 +389,17 @@ impl<'a> SceneBuilder<'a> {
         let root_pipeline = scene.pipelines.get(&root_pipeline_id).unwrap();
 
         let background_color = root_pipeline
             .background_color
             .and_then(|color| if color.a > 0.0 { Some(color) } else { None });
 
         let mut builder = SceneBuilder {
             scene,
-            clip_scroll_tree: ClipScrollTree::new(),
+            spatial_tree: SpatialTree::new(),
             font_instances,
             config: *frame_builder_config,
             output_pipelines,
             id_to_index_mapper: NodeIdToIndexMapper::default(),
             hit_testing_scene: HitTestingScene::new(&stats.hit_test_stats),
             pending_shadow_items: VecDeque::new(),
             sc_stack: Vec::new(),
             pipeline_clip_chain_stack: vec![ClipChainId::NONE],
@@ -461,17 +461,17 @@ impl<'a> SceneBuilder<'a> {
         debug_assert!(builder.sc_stack.is_empty());
 
         BuiltScene {
             has_root_pipeline: scene.has_root_pipeline(),
             pipeline_epochs: scene.pipeline_epochs.clone(),
             output_rect: view.device_rect.size.into(),
             background_color,
             hit_testing_scene: Arc::new(builder.hit_testing_scene),
-            clip_scroll_tree: builder.clip_scroll_tree,
+            spatial_tree: builder.spatial_tree,
             prim_store: builder.prim_store,
             clip_store: builder.clip_store,
             root_pic_index: builder.root_pic_index,
             config: builder.config,
             content_slice_count: builder.content_slice_count,
             picture_cache_spatial_nodes: builder.picture_cache_spatial_nodes,
         }
     }
@@ -487,17 +487,17 @@ impl<'a> SceneBuilder<'a> {
         // Get the current offset from stacking context <-> reference frame space.
         let rf_offset = self.rf_mapper.current_offset();
 
         // Get the external scroll offset, if applicable.
         let scroll_offset = self
             .external_scroll_mapper
             .external_scroll_offset(
                 spatial_node_index,
-                &self.clip_scroll_tree,
+                &self.spatial_tree,
             );
 
         rf_offset + scroll_offset
     }
 
     /// Figure out the shape of the display list, and wrap various primitive clusters
     /// into tile cache primitive instances.
     fn setup_picture_caching(
@@ -766,17 +766,17 @@ impl<'a> SceneBuilder<'a> {
         let sticky_frame_info = StickyFrameInfo::new(
             frame_rect,
             info.margins,
             info.vertical_offset_bounds,
             info.horizontal_offset_bounds,
             info.previously_applied_offset,
         );
 
-        let index = self.clip_scroll_tree.add_sticky_frame(
+        let index = self.spatial_tree.add_sticky_frame(
             parent_node_index,
             sticky_frame_info,
             info.id.pipeline_id(),
         );
         self.id_to_index_mapper.map_spatial_node(info.id, index);
     }
 
     fn build_scroll_frame(
@@ -944,17 +944,17 @@ impl<'a> SceneBuilder<'a> {
                 &current_offset,
             ),
         );
         self.pipeline_clip_chain_stack.push(clip_chain_index);
 
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             spatial_node_index,
-            &self.clip_scroll_tree,
+            &self.spatial_tree,
         );
 
         let bounds = snap_to_device.snap_rect(
             &info.bounds.translate(current_offset),
         );
 
         let content_size = snap_to_device.snap_size(&pipeline.content_size);
 
@@ -1030,17 +1030,17 @@ impl<'a> SceneBuilder<'a> {
             apply_pipeline_clip
         );
 
         let current_offset = self.current_offset(clip_and_scroll.spatial_node_index);
 
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             clip_and_scroll.spatial_node_index,
-            &self.clip_scroll_tree
+            &self.spatial_tree
         );
 
         let unsnapped_clip_rect = common.clip_rect.translate(current_offset);
         let clip_rect = snap_to_device.snap_rect(&unsnapped_clip_rect);
 
         let unsnapped_rect = bounds.map(|bounds| {
             bounds.translate(current_offset)
         });
@@ -1076,17 +1076,17 @@ impl<'a> SceneBuilder<'a> {
     pub fn snap_rect(
         &mut self,
         rect: &LayoutRect,
         target_spatial_node: SpatialNodeIndex,
     ) -> LayoutRect {
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             target_spatial_node,
-            &self.clip_scroll_tree
+            &self.spatial_tree
         );
         snap_to_device.snap_rect(rect)
     }
 
     fn build_item<'b>(
         &'b mut self,
         item: DisplayItemRef,
         pipeline_id: PipelineId,
@@ -1905,17 +1905,17 @@ impl<'a> SceneBuilder<'a> {
                         // - Only cache content that is within the main scroll root, and:
                         // - Skip caching fixed position content before / after the scroll root.
                         // This means that we don't add scrollbars, which cause lots of extra
                         // invalidations. There is ongoing work to add tags to primitives that
                         // are scrollbars. Once this lands, we can simplify this logic considerably
                         // (and add a separate picture cache slice / OS layer for scroll bars).
                         if parent_sc.pipeline_id != stacking_context.pipeline_id && self.iframe_depth == 1 {
                             self.content_slice_count = stacking_context.init_picture_caching(
-                                &self.clip_scroll_tree,
+                                &self.spatial_tree,
                                 &self.clip_store,
                                 &self.interners,
                                 &self.quality_settings,
                             );
 
                             // Mark that a user supplied tile cache was specified.
                             self.picture_caching_initialized = true;
                         }
@@ -1938,17 +1938,17 @@ impl<'a> SceneBuilder<'a> {
         };
 
         if self.sc_stack.is_empty() {
             // If we didn't encounter a content iframe, then set up picture caching slice markers
             // on the root stacking context. This can happen in Gecko when the parent process
             // provides the content display list (e.g. about:support, about:config etc).
             if !self.picture_caching_initialized {
                 self.content_slice_count = stacking_context.init_picture_caching(
-                    &self.clip_scroll_tree,
+                    &self.spatial_tree,
                     &self.clip_store,
                     &self.interners,
                     &self.quality_settings,
                 );
                 self.picture_caching_initialized = true;
             }
 
             self.setup_picture_caching(
@@ -2192,17 +2192,17 @@ impl<'a> SceneBuilder<'a> {
         reference_frame_id: SpatialId,
         parent_index: Option<SpatialNodeIndex>,
         pipeline_id: PipelineId,
         transform_style: TransformStyle,
         source_transform: PropertyBinding<LayoutTransform>,
         kind: ReferenceFrameKind,
         origin_in_parent_reference_frame: LayoutVector2D,
     ) -> SpatialNodeIndex {
-        let index = self.clip_scroll_tree.add_reference_frame(
+        let index = self.spatial_tree.add_reference_frame(
             parent_index,
             transform_style,
             source_transform,
             kind,
             origin_in_parent_reference_frame,
             pipeline_id,
         );
         self.id_to_index_mapper.map_spatial_node(reference_frame_id, index);
@@ -2235,17 +2235,17 @@ impl<'a> SceneBuilder<'a> {
         );
 
         // We can't use this with the stacking context because it does not exist
         // yet. Just create a dedicated snapper for the root.
         let snap_to_device = SpaceSnapper::new_with_target(
             spatial_node_index,
             ROOT_SPATIAL_NODE_INDEX,
             device_pixel_scale,
-            &self.clip_scroll_tree,
+            &self.spatial_tree,
         );
 
         let content_size = snap_to_device.snap_size(content_size);
         let viewport_rect = snap_to_device.snap_rect(
             &LayoutRect::new(LayoutPoint::zero(), *viewport_size),
         );
 
         self.add_scroll_frame(
@@ -2276,17 +2276,17 @@ impl<'a> SceneBuilder<'a> {
         // Map from parent ClipId to existing clip-chain.
         let mut parent_clip_chain_index = self.id_to_index_mapper.get_clip_chain_id(space_and_clip.clip_id);
         // Map the ClipId for the positioning node to a spatial node index.
         let spatial_node_index = self.id_to_index_mapper.get_spatial_node_index(space_and_clip.spatial_id);
 
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             spatial_node_index,
-            &self.clip_scroll_tree,
+            &self.spatial_tree,
         );
 
         let snapped_clip_rect = snap_to_device.snap_rect(&clip_region.main);
 
         let mut clip_count = 0;
 
         // Intern each clip item in this clip node, and add the interned
         // handle to a clip chain node, parented to form a chain.
@@ -2389,17 +2389,17 @@ impl<'a> SceneBuilder<'a> {
         external_id: Option<ExternalScrollId>,
         pipeline_id: PipelineId,
         frame_rect: &LayoutRect,
         content_size: &LayoutSize,
         scroll_sensitivity: ScrollSensitivity,
         frame_kind: ScrollFrameKind,
         external_scroll_offset: LayoutVector2D,
     ) -> SpatialNodeIndex {
-        let node_index = self.clip_scroll_tree.add_scroll_frame(
+        let node_index = self.spatial_tree.add_scroll_frame(
             parent_node_index,
             external_id,
             pipeline_id,
             frame_rect,
             content_size,
             scroll_sensitivity,
             frame_kind,
             external_scroll_offset,
@@ -2622,17 +2622,17 @@ impl<'a> SceneBuilder<'a> {
     )
     where
         P: InternablePrimitive + CreateShadow,
         Interners: AsMut<Interner<P>>,
     {
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             pending_primitive.clip_and_scroll.spatial_node_index,
-            &self.clip_scroll_tree,
+            &self.spatial_tree,
         );
 
         // Offset the local rect and clip rect by the shadow offset. The pending
         // primitive has already been snapped, but we will need to snap the
         // shadow after translation. We don't need to worry about the size
         // changing because the shadow has the same raster space as the
         // primitive, and thus we know the size is already rounded.
         let mut info = pending_primitive.info.clone();
@@ -3598,32 +3598,32 @@ impl FlattenedStackingContext {
     /// Return true if the stacking context has a valid preserve-3d property
     pub fn is_3d(&self) -> bool {
         self.transform_style == TransformStyle::Preserve3D && self.composite_ops.is_empty()
     }
 
     /// Set up appropriate cluster flags for picture caching on this stacking context.
     fn init_picture_caching(
         &mut self,
-        clip_scroll_tree: &ClipScrollTree,
+        spatial_tree: &SpatialTree,
         clip_store: &ClipStore,
         interners: &Interners,
         quality_settings: &QualitySettings,
     ) -> usize {
         struct SliceInfo {
             cluster_index: usize,
             scroll_root: SpatialNodeIndex,
         }
 
         let mut content_slice_count = 0;
         let mut slices: Vec<SliceInfo> = Vec::new();
 
         // Step through each cluster, and work out where the slice boundaries should be.
         for (cluster_index, cluster) in self.prim_list.clusters.iter().enumerate() {
-            let scroll_root = clip_scroll_tree.find_scroll_root(
+            let scroll_root = spatial_tree.find_scroll_root(
                 cluster.spatial_node_index,
             );
 
             // We want to create a slice in the following conditions:
             // (1) This cluster is a scrollbar
             // (2) Certain conditions when the scroll root changes (see below)
             // (3) No slice exists yet
             let create_new_slice =
@@ -3654,18 +3654,18 @@ impl FlattenedStackingContext {
                             // (a common case is parallax scrolling effects).
                             for prim_instance in &cluster.prim_instances {
                                 let mut current_clip_chain_id = prim_instance.clip_chain_id;
 
                                 while current_clip_chain_id != ClipChainId::NONE {
                                     let clip_chain_node = &clip_store
                                         .clip_chain_nodes[current_clip_chain_id.0 as usize];
                                     let clip_node_data = &interners.clip[clip_chain_node.handle];
-                                    let clip_scroll_root = clip_scroll_tree.find_scroll_root(clip_node_data.spatial_node_index);
-                                    if clip_scroll_root != ROOT_SPATIAL_NODE_INDEX {
+                                    let spatial_root = spatial_tree.find_scroll_root(clip_node_data.spatial_node_index);
+                                    if spatial_root != ROOT_SPATIAL_NODE_INDEX {
                                         return false;
                                     }
                                     current_clip_chain_id = clip_chain_node.parent_clip_chain_id;
                                 }
                             }
 
                             true
                         }
--- a/gfx/wr/webrender/src/spatial_node.rs
+++ b/gfx/wr/webrender/src/spatial_node.rs
@@ -1,17 +1,17 @@
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{ExternalScrollId, PipelineId, PropertyBinding, PropertyBindingId, ReferenceFrameKind, ScrollClamping, ScrollLocation};
 use api::{TransformStyle, ScrollSensitivity, StickyOffsetBounds};
 use api::units::*;
-use crate::clip_scroll_tree::{CoordinateSystem, CoordinateSystemId, SpatialNodeIndex, TransformUpdateState};
+use crate::spatial_tree::{CoordinateSystem, CoordinateSystemId, SpatialNodeIndex, TransformUpdateState};
 use euclid::{Point2D, Vector2D, SideOffsets2D};
 use crate::scene::SceneProperties;
 use crate::util::{LayoutFastTransform, MatrixHelpers, ScaleOffset, TransformedRectKind, PointHelpers};
 
 #[derive(Clone, Debug)]
 pub enum SpatialNodeType {
     /// A special kind of node that adjusts its position based on the position
     /// of its parent node and a given set of sticky positioning offset bounds.
@@ -22,17 +22,17 @@ pub enum SpatialNodeType {
     /// Transforms it's content, but doesn't clip it. Can also be adjusted
     /// by scroll events or setting scroll offsets.
     ScrollFrame(ScrollFrameInfo),
 
     /// A reference frame establishes a new coordinate space in the tree.
     ReferenceFrame(ReferenceFrameInfo),
 }
 
-/// Contains information common among all types of ClipScrollTree nodes.
+/// Contains information common among all types of SpatialTree nodes.
 #[derive(Clone, Debug)]
 pub struct SpatialNode {
     /// The scale/offset of the viewport for this spatial node, relative to the
     /// coordinate system. Includes any accumulated scrolling offsets from nodes
     /// between our reference frame and this node.
     pub viewport_transform: ScaleOffset,
 
     /// Content scale/offset relative to the coordinate system.
@@ -869,20 +869,20 @@ fn test_cst_perspective_relative_scroll(
     // to a relative scroll node that any external scroll offset is
     // ignored. This is because external scroll offsets are not
     // propagated across reference frame boundaries.
 
     // It's not currently possible to verify this with a wrench reftest,
     // since wrench doesn't understand external scroll ids. When wrench
     // supports this, we could also verify with a reftest.
 
-    use crate::clip_scroll_tree::ClipScrollTree;
+    use crate::spatial_tree::SpatialTree;
     use euclid::approxeq::ApproxEq;
 
-    let mut cst = ClipScrollTree::new();
+    let mut cst = SpatialTree::new();
     let pipeline_id = PipelineId::dummy();
     let ext_scroll_id = ExternalScrollId(1, pipeline_id);
     let transform = LayoutTransform::create_perspective(100.0);
 
     let root = cst.add_reference_frame(
         None,
         TransformStyle::Flat,
         PropertyBinding::Value(LayoutTransform::identity()),
rename from gfx/wr/webrender/src/clip_scroll_tree.rs
rename to gfx/wr/webrender/src/spatial_tree.rs
--- a/gfx/wr/webrender/src/clip_scroll_tree.rs
+++ b/gfx/wr/webrender/src/spatial_tree.rs
@@ -11,17 +11,17 @@ use crate::internal_types::{FastHashMap,
 use crate::print_tree::{PrintableTree, PrintTree, PrintTreePrinter};
 use crate::scene::SceneProperties;
 use crate::spatial_node::{ScrollFrameInfo, SpatialNode, SpatialNodeType, StickyFrameInfo, ScrollFrameKind};
 use std::{ops, u32};
 use crate::util::{FastTransform, LayoutToWorldFastTransform, MatrixHelpers, ScaleOffset, scale_factors};
 
 pub type ScrollStates = FastHashMap<ExternalScrollId, ScrollFrameInfo>;
 
-/// An id that identifies coordinate systems in the ClipScrollTree. Each
+/// An id that identifies coordinate systems in the SpatialTree. Each
 /// coordinate system has an id and those ids will be shared when the coordinates
 /// system are the same or are in the same axis-aligned space. This allows
 /// for optimizing mask generation.
 #[derive(Debug, Copy, Clone, PartialEq)]
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 pub struct CoordinateSystemId(pub u32);
 
@@ -89,17 +89,17 @@ impl ops::Not for VisibleFace {
     fn not(self) -> Self {
         match self {
             VisibleFace::Front => VisibleFace::Back,
             VisibleFace::Back => VisibleFace::Front,
         }
     }
 }
 
-pub struct ClipScrollTree {
+pub struct SpatialTree {
     /// Nodes which determine the positions (offsets and transforms) for primitives
     /// and clips.
     pub spatial_nodes: Vec<SpatialNode>,
 
     /// A list of transforms that establish new coordinate systems.
     /// Spatial nodes only establish a new coordinate system when
     /// they have a transform that is not a simple 2d translation.
     coord_systems: Vec<CoordinateSystem>,
@@ -135,17 +135,17 @@ pub struct TransformUpdateState {
     /// node will not be clipped by clips that are transformed by this node.
     pub invertible: bool,
 
     /// True if this node is a part of Preserve3D hierarchy.
     pub preserves_3d: bool,
 }
 
 
-/// Transformation between two nodes in the clip-scroll tree that can sometimes be
+/// Transformation between two nodes in the spatial tree that can sometimes be
 /// encoded more efficiently than with a full matrix.
 #[derive(Debug, Clone)]
 pub enum CoordinateSpaceMapping<Src, Dst> {
     Local,
     ScaleOffset(ScaleOffset),
     Transform(Transform3D<f32, Src, Dst>),
 }
 
@@ -213,19 +213,19 @@ impl<Src, Dst> CoordinateSpaceMapping<Sr
     }
 }
 
 enum TransformScroll {
     Scrolled,
     Unscrolled,
 }
 
-impl ClipScrollTree {
+impl SpatialTree {
     pub fn new() -> Self {
-        ClipScrollTree {
+        SpatialTree {
             spatial_nodes: Vec::new(),
             coord_systems: Vec::new(),
             pending_scroll_offsets: FastHashMap::default(),
             pipelines_to_discard: FastHashSet::default(),
             nodes_to_update: Vec::new(),
         }
     }
 
@@ -346,17 +346,17 @@ impl ClipScrollTree {
     /// Unlike `get_world_transform`, this variant doesn't account for the local scroll offset.
     pub fn get_world_viewport_transform(
         &self,
         index: SpatialNodeIndex,
     ) -> CoordinateSpaceMapping<LayoutPixel, WorldPixel> {
         self.get_world_transform_impl(index, TransformScroll::Unscrolled)
     }
 
-    /// The root reference frame, which is the true root of the ClipScrollTree. Initially
+    /// The root reference frame, which is the true root of the SpatialTree. Initially
     /// this ID is not valid, which is indicated by ```spatial_nodes``` being empty.
     pub fn root_reference_frame_index(&self) -> SpatialNodeIndex {
         // TODO(mrobinson): We should eventually make this impossible to misuse.
         debug_assert!(!self.spatial_nodes.is_empty());
         ROOT_SPATIAL_NODE_INDEX
     }
 
     /// The root scroll node which is the first child of the root reference frame.
@@ -680,33 +680,33 @@ impl ClipScrollTree {
         };
         self.get_relative_transform(node_index, parent_index)
             .visible_face()
     }
 
     #[allow(dead_code)]
     pub fn print(&self) {
         if !self.spatial_nodes.is_empty() {
-            let mut pt = PrintTree::new("clip_scroll tree");
+            let mut pt = PrintTree::new("spatial tree");
             self.print_with(&mut pt);
         }
     }
 }
 
-impl PrintableTree for ClipScrollTree {
+impl PrintableTree for SpatialTree {
     fn print_with<T: PrintTreePrinter>(&self, pt: &mut T) {
         if !self.spatial_nodes.is_empty() {
             self.print_node(self.root_reference_frame_index(), pt);
         }
     }
 }
 
 #[cfg(test)]
 fn add_reference_frame(
-    cst: &mut ClipScrollTree,
+    cst: &mut SpatialTree,
     parent: Option<SpatialNodeIndex>,
     transform: LayoutTransform,
     origin_in_parent_reference_frame: LayoutVector2D,
 ) -> SpatialNodeIndex {
     cst.add_reference_frame(
         parent,
         TransformStyle::Preserve3D,
         PropertyBinding::Value(transform),
@@ -715,17 +715,17 @@ fn add_reference_frame(
         PipelineId::dummy(),
     )
 }
 
 #[cfg(test)]
 fn test_pt(
     px: f32,
     py: f32,
-    cst: &ClipScrollTree,
+    cst: &SpatialTree,
     child: SpatialNodeIndex,
     parent: SpatialNodeIndex,
     expected_x: f32,
     expected_y: f32,
 ) {
     use euclid::approxeq::ApproxEq;
     const EPSILON: f32 = 0.0001;
 
@@ -738,17 +738,17 @@ fn test_pt(
             p, pt, m,
             );
 }
 
 #[test]
 fn test_cst_simple_translation() {
     // Basic translations only
 
-    let mut cst = ClipScrollTree::new();
+    let mut cst = SpatialTree::new();
 
     let root = add_reference_frame(
         &mut cst,
         None,
         LayoutTransform::identity(),
         LayoutVector2D::zero(),
     );
 
@@ -780,17 +780,17 @@ fn test_cst_simple_translation() {
     test_pt(100.0, 100.0, &cst, child2, child1, 100.0, 150.0);
     test_pt(100.0, 100.0, &cst, child3, root, 400.0, 350.0);
 }
 
 #[test]
 fn test_cst_simple_scale() {
     // Basic scale only
 
-    let mut cst = ClipScrollTree::new();
+    let mut cst = SpatialTree::new();
 
     let root = add_reference_frame(
         &mut cst,
         None,
         LayoutTransform::identity(),
         LayoutVector2D::zero(),
     );
 
@@ -823,17 +823,17 @@ fn test_cst_simple_scale() {
     test_pt(100.0, 100.0, &cst, child2, child1, 100.0, 200.0);
     test_pt(100.0, 100.0, &cst, child3, child1, 200.0, 400.0);
 }
 
 #[test]
 fn test_cst_scale_translation() {
     // Scale + translation
 
-    let mut cst = ClipScrollTree::new();
+    let mut cst = SpatialTree::new();
 
     let root = add_reference_frame(
         &mut cst,
         None,
         LayoutTransform::identity(),
         LayoutVector2D::zero(),
     );
 
@@ -878,17 +878,17 @@ fn test_cst_scale_translation() {
     test_pt(100.0, 100.0, &cst, child3, child1, 600.0, 0.0);
 }
 
 #[test]
 fn test_cst_translation_rotate() {
     // Rotation + translation
     use euclid::Angle;
 
-    let mut cst = ClipScrollTree::new();
+    let mut cst = SpatialTree::new();
 
     let root = add_reference_frame(
         &mut cst,
         None,
         LayoutTransform::identity(),
         LayoutVector2D::zero(),
     );
 
--- a/gfx/wr/webrender/src/util.rs
+++ b/gfx/wr/webrender/src/util.rs
@@ -111,17 +111,17 @@ impl<T> VecHelper<T> for Vec<T> {
 
 
 // Represents an optimized transform where there is only
 // a scale and translation (which are guaranteed to maintain
 // an axis align rectangle under transformation). The
 // scaling is applied first, followed by the translation.
 // TODO(gw): We should try and incorporate F <-> T units here,
 //           but it's a bit tricky to do that now with the
-//           way the current clip-scroll tree works.
+//           way the current spatial tree works.
 #[derive(Debug, Clone, Copy, MallocSizeOf)]
 #[cfg_attr(feature = "capture", derive(Serialize))]
 pub struct ScaleOffset {
     pub scale: default::Vector2D<f32>,
     pub offset: default::Vector2D<f32>,
 }
 
 impl ScaleOffset {
--- a/gfx/wr/webrender_api/src/api.rs
+++ b/gfx/wr/webrender_api/src/api.rs
@@ -950,17 +950,20 @@ pub enum DebugCommand {
     /// Sets the provided debug flags.
     SetFlags(DebugFlags),
     /// Configure if dual-source blending is used, if available.
     EnableDualSourceBlending(bool),
     /// Fetch current documents and display lists.
     FetchDocuments,
     /// Fetch current passes and batches.
     FetchPasses,
-    /// Fetch clip-scroll tree.
+    // TODO: This should be called FetchClipScrollTree. However, that requires making
+    // changes to webrender's web debugger ui, touching a 4Mb minified file that
+    // is too big to submit through the conventional means.
+    /// Fetch the spatial tree.
     FetchClipScrollTree,
     /// Fetch render tasks.
     FetchRenderTasks,
     /// Fetch screenshot.
     FetchScreenshot,
     /// Save a capture of all the documents state.
     SaveCapture(PathBuf, CaptureBits),
     /// Load a capture of all the documents state.
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -1433,17 +1433,17 @@ impl SpatialId {
 }
 
 /// An external identifier that uniquely identifies a scroll frame independent of its ClipId, which
 /// may change from frame to frame. This should be unique within a pipeline. WebRender makes no
 /// attempt to ensure uniqueness. The zero value is reserved for use by the root scroll node of
 /// every pipeline, which always has an external id.
 ///
 /// When setting display lists with the `preserve_frame_state` this id is used to preserve scroll
-/// offsets between different sets of ClipScrollNodes which are ScrollFrames.
+/// offsets between different sets of SpatialNodes which are ScrollFrames.
 #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize, PeekPoke)]
 #[repr(C)]
 pub struct ExternalScrollId(pub u64, pub PipelineId);
 
 impl ExternalScrollId {
     pub fn pipeline_id(&self) -> PipelineId {
         self.1
     }