diff --git a/components/layout/block.rs b/components/layout/block.rs index 7b04391cd14..19bb6e71ce2 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -64,7 +64,6 @@ use style::properties::ComputedValues; use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use util::geometry::MAX_RECT; -use util::opts; use util::print_tree::PrintTree; /// Information specific to floated blocks. @@ -2122,9 +2121,6 @@ impl Flow for BlockFlow { fn build_display_list(&mut self, state: &mut DisplayListBuildState) { self.build_display_list_for_block(state, BorderPaintingMode::Separate); self.fragment.restyle_damage.remove(REPAINT); - if opts::get().validate_display_list_geometry { - self.base.validate_display_list_geometry(); - } } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 500b2d9922e..abe06f3642e 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1853,10 +1853,6 @@ impl InlineFlowDisplayListBuilding for InlineFlow { self.base.build_display_items_for_debugging_tint(state, self.fragments.fragments[0].node); } - - if opts::get().validate_display_list_geometry { - self.base.validate_display_list_geometry(); - } } } diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 5ae07604f99..b53bb697c49 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -31,7 +31,6 @@ use style::logical_geometry::LogicalSize; use style::properties::ComputedValues; use style::properties::style_structs; use style::values::computed::LengthOrPercentageOrAuto; -use util::opts; // A mode describes which logical axis a flex axis is parallel with. // The logical axises are inline and block, the flex axises are main and cross. @@ -422,10 +421,6 @@ impl Flow for FlexFlow { fn build_display_list(&mut self, state: &mut DisplayListBuildState) { self.build_display_list_for_flex(state); - - if opts::get().validate_display_list_geometry { - self.block_flow.base.validate_display_list_geometry(); - } } fn collect_stacking_contexts(&mut self, diff --git a/components/layout/flow.rs b/components/layout/flow.rs index a02b718d8cd..def1f7bf8a7 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -1167,37 +1167,6 @@ impl BaseFlow { p as usize } - /// Ensures that all display list items generated by this flow are within the flow's overflow - /// rect. This should only be used for debugging. - pub fn validate_display_list_geometry(&self) { - // FIXME(pcwalton, #2795): Get the real container size. - let container_size = Size2D::zero(); - let position_with_overflow = self.position - .to_physical(self.writing_mode, container_size) - .union(&self.overflow.paint); - let bounds = Rect::new(self.stacking_relative_position, position_with_overflow.size); - - let items = match self.display_list_building_result { - Some(ref items) => items, - None => return, - }; - - for item in items.iter() { - let base_item = item.item.base(); - let mut paint_bounds = base_item.clip.clone(); - paint_bounds.intersect_rect(&base_item.bounds); - if !paint_bounds.might_be_nonempty() { - continue; - } - - if bounds.union(&paint_bounds.bounding_rect()) != bounds { - error!("DisplayList item {:?} outside of Flow overflow ({:?})", - item.item, - paint_bounds); - } - } - } - pub fn flow_id(&self) -> usize { return self as *const BaseFlow as usize; } diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index 337ba76120b..6c8817ec1da 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -25,7 +25,6 @@ use style::computed_values::{list_style_type, position}; use style::logical_geometry::LogicalSize; use style::properties::ComputedValues; use text; -use util::opts; /// A block with the CSS `display` property equal to `list-item`. #[derive(Debug)] @@ -144,9 +143,6 @@ impl Flow for ListItemFlow { fn build_display_list(&mut self, state: &mut DisplayListBuildState) { self.build_display_list_for_list_item(state); - if opts::get().validate_display_list_geometry { - self.block_flow.base.validate_display_list_geometry(); - } } fn collect_stacking_contexts(&mut self, diff --git a/components/util/opts.rs b/components/util/opts.rs index 90135fb78ca..410b9da7c11 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -163,9 +163,6 @@ pub struct Opts { /// Emits notifications when there is a relayout. pub relayout_event: bool, - /// Whether to show an error when display list geometry escapes flow overflow regions. - pub validate_display_list_geometry: bool, - /// Whether Style Sharing Cache is used pub disable_share_style_cache: bool, @@ -254,9 +251,6 @@ pub struct DebugOptions { /// Write layout trace to an external file for debugging. pub trace_layout: bool, - /// Display an error when display list geometry escapes overflow region. - pub validate_display_list_geometry: bool, - /// Disable the style sharing cache. pub disable_share_style_cache: bool, @@ -308,7 +302,6 @@ impl DebugOptions { "show-parallel-layout" => debug_options.show_parallel_layout = true, "paint-flashing" => debug_options.paint_flashing = true, "trace-layout" => debug_options.trace_layout = true, - "validate-display-list-geometry" => debug_options.validate_display_list_geometry = true, "disable-share-style-cache" => debug_options.disable_share_style_cache = true, "convert-mouse-to-touch" => debug_options.convert_mouse_to_touch = true, "replace-surrogates" => debug_options.replace_surrogates = true, @@ -351,8 +344,6 @@ pub fn print_debug_usage(app: &str) -> ! { print_option("show-parallel-layout", "Mark which thread laid each flow out with colors."); print_option("paint-flashing", "Overlay repainted areas with a random color."); print_option("trace-layout", "Write layout trace to an external file for debugging."); - print_option("validate-display-list-geometry", - "Display an error when display list geometry escapes overflow region."); print_option("disable-share-style-cache", "Disable the style sharing cache."); print_option("parallel-display-list-building", "Build display lists in parallel."); @@ -486,7 +477,6 @@ pub fn default_opts() -> Opts { dump_display_list_optimized: false, dump_layer_tree: false, relayout_event: false, - validate_display_list_geometry: false, profile_script_events: false, profile_heartbeats: false, disable_share_style_cache: false, @@ -727,7 +717,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult { dump_display_list_optimized: debug_options.dump_display_list_optimized, dump_layer_tree: debug_options.dump_layer_tree, relayout_event: debug_options.relayout_event, - validate_display_list_geometry: debug_options.validate_display_list_geometry, disable_share_style_cache: debug_options.disable_share_style_cache, convert_mouse_to_touch: debug_options.convert_mouse_to_touch, exit_after_load: opt_match.opt_present("x"),