Updated tab-logic for checking ancestry of active links.