Proper visibility handling in DOMLayer