Used shared clips for overflow:hidden and CSS clip

Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.
Fixes #8780.
This commit is contained in:
Martin Robinson 2017-03-20 10:45:59 +01:00
parent b9274b7527
commit 4451b8a771
16 changed files with 483 additions and 343 deletions

View file

@ -45,8 +45,7 @@ use euclid::rect::Rect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::Size2D;
use fnv::FnvHasher;
use gfx::display_list::{ClippingRegion, OpaqueNode};
use gfx::display_list::WebRenderImageInfo;
use gfx::display_list::{OpaqueNode, WebRenderImageInfo};
use gfx::font;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context;
@ -854,8 +853,7 @@ impl LayoutThread {
LogicalPoint::zero(writing_mode).to_physical(writing_mode,
self.viewport_size);
flow::mut_base(layout_root).clip =
ClippingRegion::from_rect(&data.page_clip_rect);
flow::mut_base(layout_root).clip = data.page_clip_rect;
if flow::base(layout_root).restyle_damage.contains(REPOSITION) {
layout_root.traverse_preorder(&ComputeAbsolutePositions {