augment `visible` to also check if the element is on-screen
fix failure cases, update tests