From 8aa9427af0a6008acf421110115356c0dfcf768c Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Mon, 20 Apr 2015 12:17:38 -0700 Subject: [PATCH] Skip computing fragment position and return early if visibility property is not set. --- components/layout/display_list_builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index a8f4d8e8bd1..e92d0411216 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -790,6 +790,10 @@ impl FragmentDisplayListBuilding for Fragment { relative_containing_block_mode: WritingMode, background_and_border_level: BackgroundAndBorderLevel, clip: &ClippingRegion) { + 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. @@ -807,10 +811,6 @@ impl FragmentDisplayListBuilding for Fragment { stacking_relative_flow_origin, self); - if self.style().get_inheritedbox().visibility != visibility::T::visible { - return - } - if !stacking_relative_border_box.intersects(&layout_context.shared.dirty) { debug!("Fragment::build_display_list: Did not intersect..."); return