Checks whether a leaf layout can be removed.

A layout that has no children or no background can often be removed (since it is invisible) for a flatter and more efficient layout hierarchy.