Use real clips when generating scroll roots

This is the first step toward removing inherited clips in favor of
scroll roots for handling overflow and CSS clipping. This will allow us
to more easily handle elements that should not be clipped. While we are
still using inherited clips here, we now properly clip some types of
content that wasn't clipped before.
This commit is contained in:
Martin Robinson 2017-04-06 14:43:29 +02:00
parent 21eafebd37
commit 0353aad4e3
6 changed files with 134 additions and 12 deletions

View file

@ -421,15 +421,11 @@ impl WebRenderDisplayItemConverter for DisplayItem {
}
DisplayItem::PopStackingContext(_) => builder.pop_stacking_context(),
DisplayItem::PushScrollRoot(ref item) => {
let clip = builder.new_clip_region(&item.scroll_root.clip.to_rectf(),
vec![],
None);
let provided_id = ScrollLayerId::new(item.scroll_root.id.0 as u64, builder.pipeline_id);
let id = builder.define_clip(item.scroll_root.content_rect.to_rectf(),
clip,
Some(provided_id));
debug_assert!(provided_id == id);
let our_id = ScrollLayerId::new(item.scroll_root.id.0 as u64, builder.pipeline_id);
let clip = item.scroll_root.clip.to_clip_region(builder);
let content_rect = item.scroll_root.content_rect.to_rectf();
let webrender_id = builder.define_clip(content_rect, clip, Some(our_id));
debug_assert!(our_id == webrender_id);
}
DisplayItem::PopScrollRoot(_) => {} //builder.pop_scroll_layer(),
}