diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/block.rs | 6 | ||||
-rw-r--r-- | components/layout/display_list_builder.rs | 4 | ||||
-rw-r--r-- | components/layout/layout_task.rs | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs index 8835682644d..baf80f6ca3f 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -48,7 +48,7 @@ use geom::Size2D; use gfx::display_list::BlockLevel; use serialize::{Encoder, Encodable}; use servo_msg::compositor_msg::LayerId; -use servo_util::geometry::{Au, MAX_AU, MAX_RECT}; +use servo_util::geometry::{Au, MAX_AU}; use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; use servo_util::opts; use std::cmp::{max, min}; @@ -1665,10 +1665,6 @@ impl Flow for BlockFlow { // FIXME(#2795): Get the real container size let container_size = Size2D::zero(); - if self.is_root() { - self.base.clip_rect = MAX_RECT; - } - if self.base.flags.is_absolutely_positioned() { let position_start = self.base.position.start.to_physical(self.base.writing_mode, container_size); diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 4a6da7b514b..ae2984f8091 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -499,6 +499,10 @@ impl FragmentDisplayListBuilding for Fragment { return } + if !absolute_fragment_bounds.intersects(clip_rect) { + return; + } + debug!("Fragment::build_display_list: intersected. Adding display item..."); if self.is_primary_fragment() { diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 1ed51197db2..e1e918251cd 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -625,6 +625,8 @@ impl LayoutTask { LogicalPoint::zero(writing_mode).to_physical(writing_mode, rw_data.screen_size); + flow::mut_base(layout_root.deref_mut()).clip_rect = data.page_clip_rect; + let rw_data = rw_data.deref_mut(); match rw_data.parallel_traversal { None => { |