Mask root layer rectangles to their boundaries

This prevents iframes contents from overflowing their root layers.