Util to check if dom elements belong to a view or sub view