Check a tag's full parentage when determining whether it has been
visited previous. This helps in an awkward situation where the same
tag appears twice within a document, under different contexts.