In compositing scenarios like the one in the screenshot, we should put the gray box into its own layer, since it sits far outside of its parent, and backing store usage would be much lower that way.
Created attachment 131480 [details] Interactive testcase
Created attachment 154792 [details] Screenshot
This is proving hard to fix. I have a patch, but it causes clip rect assertions. If we break apart a single compositing layer into multiple layers, then a layer RenderLayer B can have a parent, RenderLayer A, that is not its stacking context. When computing clip rects for A, it acts as the clipping root. When computing clip rects for B, we walk up through A, but are using a different clipping root. So we hit assertions.
<rdar://problem/11983250>
<rdar://problem/10719381>
Created attachment 155189 [details] WIP patch
The clip rect assertion is present before this patch.