servo: Merge #14020 - Fold some DisplayList methods into DisplayListBuildState (from mrobinson:scroll_root_prep); r=pcwalton
authorMartin Robinson <mrobinson@igalia.com>
Wed, 02 Nov 2016 13:55:07 -0500
changeset 369069 95dbf80ffecd90f5b67575d0d028376722e0c3c1
parent 369068 b603cad6140f8ca51d36cdf429e795e78254ab2c
child 369070 52f8204eba56d1d131a63b43799880890406d878
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton
servo: Merge #14020 - Fold some DisplayList methods into DisplayListBuildState (from mrobinson:scroll_root_prep); r=pcwalton <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should not change behavior. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This makes the API used to build display lists quite a bit simpler and reduces the amount of auxiliary data structures that need to be passed around. It is also important preparation work for separating scrolling areas from stacking contexts. Source-Repo: https://github.com/servo/servo Source-Revision: 021cabd3e6242b3537addec32010ee8cee556121
servo/components/gfx/display_list/mod.rs
servo/components/layout/display_list_builder.rs
servo/components/layout/sequential.rs
servo/components/layout_thread/lib.rs
--- a/servo/components/gfx/display_list/mod.rs
+++ b/servo/components/gfx/display_list/mod.rs
@@ -24,17 +24,16 @@ use gfx_traits::{ScrollPolicy, ScrollRoo
 use gfx_traits::print_tree::PrintTree;
 use ipc_channel::ipc::IpcSharedMemory;
 use msg::constellation_msg::PipelineId;
 use net_traits::image::base::{Image, PixelFormat};
 use range::Range;
 use std::cmp::{self, Ordering};
 use std::collections::HashMap;
 use std::fmt;
-use std::mem;
 use std::sync::Arc;
 use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
 use style_traits::cursor::Cursor;
 use text::TextRun;
 use text::glyph::ByteIndex;
 use util::geometry::{self, max_rect};
 use webrender_traits::{self, WebGLContextId};
 
@@ -49,106 +48,16 @@ pub use azure::azure_hl::GradientStop;
 pub static BLUR_INFLATION_FACTOR: i32 = 3;
 
 #[derive(HeapSizeOf, Deserialize, Serialize)]
 pub struct DisplayList {
     pub list: Vec<DisplayItem>,
 }
 
 impl DisplayList {
-    pub fn new(root_stacking_context: StackingContext,
-               all_items: Vec<DisplayItem>)
-               -> DisplayList {
-        let mut mapped_items = HashMap::new();
-        for item in all_items.into_iter() {
-            let items = mapped_items.entry(item.stacking_context_id()).or_insert(Vec::new());
-            items.push(item);
-        }
-
-        let mut list = Vec::new();
-        DisplayList::generate_display_list(&mut list, &mut mapped_items, root_stacking_context);
-
-        DisplayList {
-            list: list,
-        }
-    }
-
-    fn generate_display_list(list: &mut Vec<DisplayItem>,
-                             mapped_items: &mut HashMap<StackingContextId, Vec<DisplayItem>>,
-                             mut stacking_context: StackingContext) {
-        let mut child_stacking_contexts =
-            mem::replace(&mut stacking_context.children, Vec::new());
-        child_stacking_contexts.sort();
-        let mut child_stacking_contexts = child_stacking_contexts.into_iter().peekable();
-
-        let mut child_items = mapped_items.remove(&stacking_context.id)
-                                          .unwrap_or(Vec::new());
-        child_items.sort_by(|a, b| a.base().section.cmp(&b.base().section));
-        child_items.reverse();
-
-        let stacking_context_id = stacking_context.id;
-        let real_stacking_context = stacking_context.context_type == StackingContextType::Real;
-        if real_stacking_context {
-            list.push(DisplayItem::PushStackingContext(Box::new(PushStackingContextItem {
-                base: BaseDisplayItem::empty(),
-                stacking_context: stacking_context,
-            })));
-        }
-
-        // Properly order display items that make up a stacking context. "Steps" here
-        // refer to the steps in CSS 2.1 Appendix E.
-        // Steps 1 and 2: Borders and background for the root.
-        while child_items.last().map_or(false,
-             |child| child.section() == DisplayListSection::BackgroundAndBorders) {
-            list.push(child_items.pop().unwrap());
-        }
-
-        // Step 3: Positioned descendants with negative z-indices.
-        while child_stacking_contexts.peek().map_or(false, |child| child.z_index < 0) {
-            let context = child_stacking_contexts.next().unwrap();
-            DisplayList::generate_display_list(list, mapped_items, context);
-        }
-
-        // Step 4: Block backgrounds and borders.
-        while child_items.last().map_or(false,
-             |child| child.section() == DisplayListSection::BlockBackgroundsAndBorders) {
-            list.push(child_items.pop().unwrap());
-        }
-
-        // Step 5: Floats.
-        while child_stacking_contexts.peek().map_or(false,
-            |child| child.context_type == StackingContextType::PseudoFloat) {
-            let context = child_stacking_contexts.next().unwrap();
-            DisplayList::generate_display_list(list, mapped_items, context);
-        }
-
-        // Step 6 & 7: Content and inlines that generate stacking contexts.
-        while child_items.last().map_or(false,
-             |child| child.section() == DisplayListSection::Content) {
-            list.push(child_items.pop().unwrap());
-        }
-
-        // Step 8 & 9: Positioned descendants with nonnegative, numeric z-indices.
-        for child in child_stacking_contexts {
-            DisplayList::generate_display_list(list, mapped_items, child);
-        }
-
-        // Step 10: Outlines.
-        list.extend(child_items);
-
-        if real_stacking_context {
-            list.push(DisplayItem::PopStackingContext(Box::new(
-                PopStackingContextItem {
-                    base: BaseDisplayItem::empty(),
-                    stacking_context_id: stacking_context_id,
-                }
-            )));
-        }
-    }
-
     // Return all nodes containing the point of interest, bottommost first, and
     // respecting the `pointer-events` CSS property.
     pub fn hit_test(&self,
                     translated_point: &Point2D<Au>,
                     client_point: &Point2D<Au>,
                     scroll_offsets: &ScrollOffsetMap)
                     -> Vec<DisplayItemMetadata> {
         let mut result = Vec::new();
@@ -419,16 +328,32 @@ impl StackingContext {
             perspective: perspective,
             establishes_3d_context: establishes_3d_context,
             scroll_policy: scroll_policy,
             children: Vec::new(),
             overflow_scroll_id: scroll_root_id,
         }
     }
 
+    #[inline]
+    pub fn root() -> StackingContext {
+        StackingContext::new(StackingContextId::new(0),
+                             StackingContextType::Real,
+                             &Rect::zero(),
+                             &Rect::zero(),
+                             0,
+                             filter::T::new(Vec::new()),
+                             mix_blend_mode::T::normal,
+                             Matrix4D::identity(),
+                             Matrix4D::identity(),
+                             true,
+                             ScrollPolicy::Scrollable,
+                             None)
+    }
+
     pub fn add_child(&mut self, mut child: StackingContext) {
         child.update_overflow_for_all_children();
         self.children.push(child);
     }
 
     pub fn child_at_mut(&mut self, index: usize) -> &mut StackingContext {
         &mut self.children[index]
     }
@@ -469,16 +394,37 @@ impl StackingContext {
 
     pub fn print_with_tree(&self, print_tree: &mut PrintTree) {
         print_tree.new_level(format!("{:?}", self));
         for kid in self.children() {
             kid.print_with_tree(print_tree);
         }
         print_tree.end_level();
     }
+
+    pub fn to_display_list_items(self) -> (DisplayItem, DisplayItem) {
+        let mut base_item = BaseDisplayItem::empty();
+        base_item.stacking_context_id = self.id;
+
+        let pop_item = DisplayItem::PopStackingContext(Box::new(
+            PopStackingContextItem {
+                base: base_item.clone(),
+                stacking_context_id: self.id,
+            }
+        ));
+
+        let push_item = DisplayItem::PushStackingContext(Box::new(
+            PushStackingContextItem {
+                base: base_item,
+                stacking_context: self,
+            }
+        ));
+
+        (push_item, pop_item)
+    }
 }
 
 impl Ord for StackingContext {
     fn cmp(&self, other: &Self) -> Ordering {
         if self.z_index != 0 || other.z_index != 0 {
             return self.z_index.cmp(&other.z_index);
         }
 
--- a/servo/components/layout/display_list_builder.rs
+++ b/servo/components/layout/display_list_builder.rs
@@ -18,32 +18,34 @@ use context::SharedLayoutContext;
 use euclid::{Matrix4D, Point2D, Radians, Rect, SideOffsets2D, Size2D};
 use flex::FlexFlow;
 use flow::{BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED};
 use flow_ref;
 use fragment::{CoordinateSystem, Fragment, ImageFragmentInfo, ScannedTextFragmentInfo};
 use fragment::SpecificFragmentInfo;
 use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem};
 use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion};
-use gfx::display_list::{DisplayItem, DisplayItemMetadata, DisplayListSection, GradientDisplayItem};
-use gfx::display_list::{GradientStop, IframeDisplayItem, ImageDisplayItem, WebGLDisplayItem};
+use gfx::display_list::{DisplayItem, DisplayItemMetadata, DisplayList, DisplayListSection};
+use gfx::display_list::{GradientDisplayItem, GradientStop, IframeDisplayItem, ImageDisplayItem};
 use gfx::display_list::{LineDisplayItem, OpaqueNode};
 use gfx::display_list::{SolidColorDisplayItem, StackingContext, StackingContextType};
-use gfx::display_list::{TextDisplayItem, TextOrientation, WebRenderImageInfo};
+use gfx::display_list::{TextDisplayItem, TextOrientation, WebGLDisplayItem, WebRenderImageInfo};
 use gfx_traits::{ScrollPolicy, ScrollRootId, StackingContextId};
 use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT};
 use ipc_channel::ipc;
 use list_item::ListItemFlow;
 use model::{self, MaybeAuto, ToGfxMatrix};
 use net_traits::image::base::PixelFormat;
 use net_traits::image_cache_thread::UsePlaceholder;
 use range::Range;
 use script_layout_interface::restyle_damage::REPAINT;
 use std::{cmp, f32};
+use std::collections::HashMap;
 use std::default::Default;
+use std::mem;
 use std::sync::Arc;
 use style::computed_values::{background_attachment, background_clip, background_origin};
 use style::computed_values::{background_repeat, background_size, border_style};
 use style::computed_values::{cursor, image_rendering, overflow_x, pointer_events, position};
 use style::computed_values::{transform, transform_style, visibility};
 use style::computed_values::_servo_overflow_clip_box as overflow_clip_box;
 use style::computed_values::filter::Filter;
 use style::computed_values::text_shadow::TextShadow;
@@ -71,35 +73,38 @@ static THREAD_TINT_COLORS: [Color; 8] = 
 ];
 
 fn get_cyclic<T>(arr: &[T], index: usize) -> &T {
     &arr[index % arr.len()]
 }
 
 pub struct DisplayListBuildState<'a> {
     pub shared_layout_context: &'a SharedLayoutContext,
-    pub items: Vec<DisplayItem>,
+    pub root_stacking_context: StackingContext,
+    pub items: HashMap<StackingContextId, Vec<DisplayItem>>,
     pub stacking_context_id_stack: Vec<StackingContextId>,
     pub scroll_root_id_stack: Vec<ScrollRootId>,
 }
 
 impl<'a> DisplayListBuildState<'a> {
     pub fn new(shared_layout_context: &'a SharedLayoutContext,
                stacking_context_id: StackingContextId)
                -> DisplayListBuildState<'a> {
         DisplayListBuildState {
             shared_layout_context: shared_layout_context,
-            items: Vec::new(),
+            root_stacking_context: StackingContext::root(),
+            items: HashMap::new(),
             stacking_context_id_stack: vec!(stacking_context_id),
             scroll_root_id_stack: vec!(ScrollRootId::root()),
         }
     }
 
     fn add_display_item(&mut self, display_item: DisplayItem) {
-        self.items.push(display_item);
+        let items = self.items.entry(display_item.stacking_context_id()).or_insert(Vec::new());
+        items.push(display_item);
     }
 
     pub fn stacking_context_id(&self) -> StackingContextId {
         self.stacking_context_id_stack.last().unwrap().clone()
     }
 
     pub fn push_stacking_context_id(&mut self, stacking_context_id: StackingContextId) {
         self.stacking_context_id_stack.push(stacking_context_id);
@@ -134,16 +139,101 @@ impl<'a> DisplayListBuildState<'a> {
                              DisplayItemMetadata {
                                  node: node,
                                  pointing: cursor,
                              },
                              &clip,
                              section,
                              self.stacking_context_id())
     }
+
+    pub fn to_display_list(mut self) -> DisplayList {
+        let mut list = Vec::new();
+        let root_context = mem::replace(&mut self.root_stacking_context, StackingContext::root());
+
+        self.to_display_list_for_stacking_context(&mut list, root_context);
+
+        DisplayList {
+            list: list,
+        }
+    }
+
+    fn to_display_list_for_stacking_context(&mut self,
+                                            list: &mut Vec<DisplayItem>,
+                                            mut stacking_context: StackingContext) {
+        let mut child_items = self.items.remove(&stacking_context.id).unwrap_or(Vec::new());
+        child_items.sort_by(|a, b| a.base().section.cmp(&b.base().section));
+        child_items.reverse();
+
+        let mut child_stacking_contexts =
+            mem::replace(&mut stacking_context.children, Vec::new());
+        child_stacking_contexts.sort();
+
+        let real_stacking_context = stacking_context.context_type == StackingContextType::Real;
+        if !real_stacking_context {
+            self.to_display_list_for_items(list,
+                                           child_items,
+                                           child_stacking_contexts);
+            return;
+        }
+
+        let (push_item, pop_item) = stacking_context.to_display_list_items();
+        list.push(push_item);
+        self.to_display_list_for_items(list,
+                                       child_items,
+                                       child_stacking_contexts);
+        list.push(pop_item);
+    }
+
+    fn to_display_list_for_items(&mut self,
+                                 list: &mut Vec<DisplayItem>,
+                                 mut child_items: Vec<DisplayItem>,
+                                 child_stacking_contexts: Vec<StackingContext>) {
+        // Properly order display items that make up a stacking context. "Steps" here
+        // refer to the steps in CSS 2.1 Appendix E.
+        // Steps 1 and 2: Borders and background for the root.
+        while child_items.last().map_or(false,
+             |child| child.section() == DisplayListSection::BackgroundAndBorders) {
+            list.push(child_items.pop().unwrap());
+        }
+
+        // Step 3: Positioned descendants with negative z-indices.
+        let mut child_stacking_contexts = child_stacking_contexts.into_iter().peekable();
+        while child_stacking_contexts.peek().map_or(false, |child| child.z_index < 0) {
+            let context = child_stacking_contexts.next().unwrap();
+            self.to_display_list_for_stacking_context(list, context);
+        }
+
+        // Step 4: Block backgrounds and borders.
+        while child_items.last().map_or(false,
+             |child| child.section() == DisplayListSection::BlockBackgroundsAndBorders) {
+            list.push(child_items.pop().unwrap());
+        }
+
+        // Step 5: Floats.
+        while child_stacking_contexts.peek().map_or(false,
+            |child| child.context_type == StackingContextType::PseudoFloat) {
+            let context = child_stacking_contexts.next().unwrap();
+            self.to_display_list_for_stacking_context(list, context);
+        }
+
+        // Step 6 & 7: Content and inlines that generate stacking contexts.
+        while child_items.last().map_or(false,
+             |child| child.section() == DisplayListSection::Content) {
+            list.push(child_items.pop().unwrap());
+        }
+
+        // Step 8 & 9: Positioned descendants with nonnegative, numeric z-indices.
+        for child in child_stacking_contexts {
+            self.to_display_list_for_stacking_context(list, child);
+        }
+
+        // Step 10: Outlines.
+        list.extend(child_items);
+    }
 }
 
 /// The logical width of an insertion point: at the moment, a one-pixel-wide line.
 const INSERTION_POINT_LOGICAL_WIDTH: Au = Au(1 * AU_PER_PX);
 
 // TODO(gw): The transforms spec says that perspective length must
 // be positive. However, there is some confusion between the spec
 // and browser implementations as to handling the case of 0 for the
--- a/servo/components/layout/sequential.rs
+++ b/servo/components/layout/sequential.rs
@@ -9,17 +9,16 @@ use context::{LayoutContext, SharedLayou
 use display_list_builder::DisplayListBuildState;
 use euclid::point::Point2D;
 use floats::SpeculatedFloatPlacement;
 use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils};
 use flow::{PostorderFlowTraversal, PreorderFlowTraversal};
 use flow::IS_ABSOLUTELY_POSITIONED;
 use fragment::FragmentBorderBoxIterator;
 use generated_content::ResolveGeneratedContent;
-use gfx::display_list::{DisplayItem, StackingContext};
 use gfx_traits::ScrollRootId;
 use script_layout_interface::restyle_damage::{REFLOW, STORE_OVERFLOW};
 use style::context::StyleContext;
 use traversal::{AssignBSizes, AssignISizes, BubbleISizes, BuildDisplayList};
 use util::opts;
 
 pub use style::sequential::traverse_dom;
 
@@ -70,27 +69,26 @@ pub fn traverse_flow_tree_preorder(root:
     }
 
     let assign_inline_sizes = AssignISizes { shared_context: layout_context.shared_context() };
     let assign_block_sizes  = AssignBSizes { layout_context: &layout_context };
 
     doit(root, assign_inline_sizes, assign_block_sizes);
 }
 
-pub fn build_display_list_for_subtree(flow_root: &mut Flow,
-                                      root_stacking_context: &mut StackingContext,
-                                      shared_layout_context: &SharedLayoutContext)
-                                      -> Vec<DisplayItem> {
-    flow_root.collect_stacking_contexts(root_stacking_context, ScrollRootId::root());
-    let mut build_display_list = BuildDisplayList {
-        state: DisplayListBuildState::new(shared_layout_context,
-                                          flow::base(flow_root).stacking_context_id),
-    };
+pub fn build_display_list_for_subtree<'a>(flow_root: &mut Flow,
+                                          shared_layout_context: &'a SharedLayoutContext)
+                                          -> DisplayListBuildState<'a> {
+    let mut state = DisplayListBuildState::new(shared_layout_context,
+                                               flow::base(flow_root).stacking_context_id);
+    flow_root.collect_stacking_contexts(&mut state.root_stacking_context, ScrollRootId::root());
+
+    let mut build_display_list = BuildDisplayList { state: state };
     build_display_list.traverse(flow_root);
-    build_display_list.state.items
+    build_display_list.state
 }
 
 pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut Flow,
                                                        iterator: &mut FragmentBorderBoxIterator) {
     fn doit(flow: &mut Flow,
             level: i32,
             iterator: &mut FragmentBorderBoxIterator,
             stacking_context_position: &Point2D<Au>) {
--- a/servo/components/layout_thread/lib.rs
+++ b/servo/components/layout_thread/lib.rs
@@ -42,28 +42,26 @@ extern crate selectors;
 extern crate serde_json;
 extern crate style;
 extern crate url;
 extern crate util;
 extern crate webrender_traits;
 
 use app_units::Au;
 use azure::azure_hl::Color;
-use euclid::Matrix4D;
 use euclid::point::Point2D;
 use euclid::rect::Rect;
 use euclid::scale_factor::ScaleFactor;
 use euclid::size::Size2D;
 use fnv::FnvHasher;
-use gfx::display_list::{ClippingRegion, DisplayList, OpaqueNode};
-use gfx::display_list::{StackingContext, StackingContextType, WebRenderImageInfo};
+use gfx::display_list::{ClippingRegion, OpaqueNode, WebRenderImageInfo};
 use gfx::font;
 use gfx::font_cache_thread::FontCacheThread;
 use gfx::font_context;
-use gfx_traits::{Epoch, FragmentType, ScrollPolicy, ScrollRootId, StackingContextId};
+use gfx_traits::{Epoch, FragmentType, ScrollRootId};
 use heapsize::HeapSizeOf;
 use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
 use ipc_channel::router::ROUTER;
 use layout::animation;
 use layout::construct::ConstructionResult;
 use layout::context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context};
 use layout::display_list_builder::ToGfxColor;
 use layout::flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils};
@@ -102,17 +100,16 @@ use std::borrow::ToOwned;
 use std::collections::HashMap;
 use std::hash::BuildHasherDefault;
 use std::ops::{Deref, DerefMut};
 use std::process;
 use std::sync::{Arc, Mutex, MutexGuard};
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::sync::mpsc::{Receiver, Sender, channel};
 use style::animation::Animation;
-use style::computed_values::{filter, mix_blend_mode};
 use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext};
 use style::dom::{TDocument, TElement, TNode};
 use style::error_reporting::{ParseErrorReporter, StdoutErrorReporter};
 use style::logical_geometry::LogicalPoint;
 use style::media_queries::{Device, MediaType};
 use style::parallel::WorkQueueData;
 use style::parser::ParserContextExtraData;
 use style::selector_matching::Stylist;
@@ -905,53 +902,35 @@ impl LayoutThread {
             }
 
             if flow::base(layout_root).restyle_damage.contains(REPAINT) ||
                     rw_data.display_list.is_none() {
                 let display_list_needed = query_type.map(reflow_query_type_needs_display_list)
                                                     .unwrap_or(false);
                 match (data.goal, display_list_needed) {
                     (ReflowGoal::ForDisplay, _) | (ReflowGoal::ForScriptQuery, true) => {
-                        let mut root_stacking_context =
-                            StackingContext::new(StackingContextId::new(0),
-                                                 StackingContextType::Real,
-                                                 &Rect::zero(),
-                                                 &Rect::zero(),
-                                                 0,
-                                                 filter::T::new(Vec::new()),
-                                                 mix_blend_mode::T::normal,
-                                                 Matrix4D::identity(),
-                                                 Matrix4D::identity(),
-                                                 true,
-                                                 ScrollPolicy::Scrollable,
-                                                 None);
-
-                        let display_list_entries =
-                            sequential::build_display_list_for_subtree(layout_root,
-                                                                       &mut root_stacking_context,
-                                                                       shared_layout_context);
+                        let mut build_state =
+                             sequential::build_display_list_for_subtree(layout_root,
+                                                                        shared_layout_context);
 
                         debug!("Done building display list.");
 
                         let root_size = {
                             let root_flow = flow::base(layout_root);
                             if rw_data.stylist.viewport_constraints().is_some() {
                                 root_flow.position.size.to_physical(root_flow.writing_mode)
                             } else {
                                 root_flow.overflow.scroll.size
                             }
                         };
 
                         let origin = Rect::new(Point2D::new(Au(0), Au(0)), root_size);
-                        root_stacking_context.bounds = origin;
-                        root_stacking_context.overflow = origin;
-
-                        rw_data.display_list =
-                            Some(Arc::new(DisplayList::new(root_stacking_context,
-                                                           display_list_entries)))
+                        build_state.root_stacking_context.bounds = origin;
+                        build_state.root_stacking_context.overflow = origin;
+                        rw_data.display_list = Some(Arc::new(build_state.to_display_list()));
                     }
                     (ReflowGoal::ForScriptQuery, false) => {}
                 }
             }
 
             if data.goal != ReflowGoal::ForDisplay {
                 // Defer the paint step until the next ForDisplay.
                 //