Allow layers to mask children to their boundaries

This allows preventing iframes from overlowing their boundaries. We
also ensure that buffer requests are made for child layers, even when
their parents don't overlap the window rect. This is because children
can lie completely outside the bounds of their parents.
Why not just set `clip_rect` to `None` and then match on it below again? I know it's a bit more verbose, but I think that pattern matching is more clear than an early return.