Integration with .pat-depends

Check for .pat-depends ancestors and only focus if the input is visible and the
.pat-depends criteria has been matched.