Don't create a chain of layouts that contain a cycle. For example, don't create a layout whose layout is itself. Don't allow an end user to violate recursion invariants (rules) through malicious data entry or JavaScript interop calls.