servo: Merge #11752 - Minor code cleanup in layout (from mbrubeck:cleanup); r=pcwalton
authorMatt Brubeck <mbrubeck@limpet.net>
Tue, 21 Jun 2016 17:51:26 -0500
changeset 339110 1bb22d7be3d40a9b688c0d7e9325b76c5a67ea80
parent 339109 48b6d1049f449393c16e8627cf623faba317c822
child 339111 9b90ef6c003a83cf171ab3b93f4c9c4b4f0fc68a
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton
servo: Merge #11752 - Minor code cleanup in layout (from mbrubeck:cleanup); r=pcwalton r? @pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 47387a5c442c5a0167b5286fa1113124ba8d67db
servo/components/layout/block.rs
servo/components/layout/display_list_builder.rs
servo/components/layout/inline.rs
servo/components/layout/table.rs
--- a/servo/components/layout/block.rs
+++ b/servo/components/layout/block.rs
@@ -44,17 +44,17 @@ use flow_ref::FlowRef;
 use fragment::SpecificFragmentInfo;
 use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER, Overflow};
 use gfx::display_list::{ClippingRegion, StackingContext};
 use gfx_traits::{LayerId, StackingContextId};
 use layout_debug;
 use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none};
 use model::{self, IntrinsicISizes, MarginCollapseInfo};
 use rustc_serialize::{Encodable, Encoder};
-use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT};
+use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
 use std::cmp::{max, min};
 use std::fmt;
 use std::sync::Arc;
 use style::computed_values::{border_collapse, box_sizing, display, float, overflow_x, overflow_y};
 use style::computed_values::{position, text_align, transform, transform_style};
 use style::context::StyleContext;
 use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
 use style::properties::{ComputedValues, ServoComputedValues};
@@ -2131,17 +2131,16 @@ impl Flow for BlockFlow {
                                  parent_id: StackingContextId,
                                  contexts: &mut Vec<Box<StackingContext>>)
                                  -> StackingContextId {
         self.collect_stacking_contexts_for_block(parent_id, contexts)
     }
 
     fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
         self.build_display_list_for_block(state, BorderPaintingMode::Separate);
-        self.fragment.restyle_damage.remove(REPAINT);
     }
 
     fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
         self.fragment.repair_style(new_style)
     }
 
     fn compute_overflow(&self) -> Overflow {
         let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
--- a/servo/components/layout/display_list_builder.rs
+++ b/servo/components/layout/display_list_builder.rs
@@ -33,16 +33,17 @@ use gfx::text::glyph::ByteIndex;
 use gfx_traits::{color, ScrollPolicy, 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::default::Default;
 use std::sync::Arc;
 use std::{cmp, f32};
 use style::computed_values::filter::Filter;
 use style::computed_values::{_servo_overflow_clip_box as overflow_clip_box};
 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};
@@ -1006,16 +1007,17 @@ impl FragmentDisplayListBuilding for Fra
                           state: &mut DisplayListBuildState,
                           stacking_relative_flow_origin: &Point2D<Au>,
                           relative_containing_block_size: &LogicalSize<Au>,
                           relative_containing_block_mode: WritingMode,
                           border_painting_mode: BorderPaintingMode,
                           display_list_section: DisplayListSection,
                           clip: &ClippingRegion,
                           stacking_relative_display_port: &Rect<Au>) {
+        self.restyle_damage.remove(REPAINT);
         if self.style().get_inheritedbox().visibility != visibility::T::visible {
             return
         }
 
         // Compute the fragment position relative to the parent stacking context. If the fragment
         // itself establishes a stacking context, then the origin of its position will be (0, 0)
         // for the purposes of this computation.
         let stacking_relative_border_box =
--- a/servo/components/layout/inline.rs
+++ b/servo/components/layout/inline.rs
@@ -19,18 +19,18 @@ use fragment::SpecificFragmentInfo;
 use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
 use gfx::display_list::{OpaqueNode, StackingContext};
 use gfx::font::FontMetrics;
 use gfx::font_context::FontContext;
 use gfx_traits::StackingContextId;
 use layout_debug;
 use model::IntrinsicISizesContribution;
 use range::{Range, RangeIndex};
-use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
-use script_layout_interface::restyle_damage::{REPAINT, RESOLVE_GENERATED_CONTENT};
+use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW};
+use script_layout_interface::restyle_damage::{REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT};
 use script_layout_interface::wrapper_traits::PseudoElementType;
 use std::cmp::max;
 use std::collections::VecDeque;
 use std::sync::Arc;
 use std::{fmt, i32, isize, mem};
 use style::computed_values::{display, overflow_x, position, text_align, text_justify};
 use style::computed_values::{text_overflow, vertical_align, white_space};
 use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
@@ -1637,20 +1637,16 @@ impl Flow for InlineFlow {
                                  parent_id: StackingContextId,
                                  contexts: &mut Vec<Box<StackingContext>>)
                                  -> StackingContextId {
         self.collect_stacking_contexts_for_inline(parent_id, contexts)
     }
 
     fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
         self.build_display_list_for_inline(state);
-
-        for fragment in &mut self.fragments.fragments {
-            fragment.restyle_damage.remove(REPAINT);
-        }
     }
 
     fn repair_style(&mut self, _: &Arc<ServoComputedValues>) {}
 
     fn compute_overflow(&self) -> Overflow {
         let mut overflow = Overflow::new();
         let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
         let relative_containing_block_size =
--- a/servo/components/layout/table.rs
+++ b/servo/components/layout/table.rs
@@ -130,17 +130,17 @@ impl TableFlow {
             }
         }
 
         total_inline_sizes
     }
 
     /// Updates the minimum and preferred inline-size calculation for a single row. This is
     /// factored out into a separate function because we process children of rowgroups too.
-    fn update_column_inline_sizes_for_row(row: &mut TableRowFlow,
+    fn update_column_inline_sizes_for_row(row: &TableRowFlow,
                                           column_inline_sizes: &mut Vec<ColumnIntrinsicInlineSize>,
                                           computation: &mut IntrinsicISizesContribution,
                                           first_row: bool,
                                           table_layout: TableLayout) {
         // Read column inline-sizes from the table-row, and assign inline-size=0 for the columns
         // not defined in the column group.
         //
         // FIXME: Need to read inline-sizes from either table-header-group OR the first table-row.