Ah, okay. I didn't catch that you wanted "the nearest ancestor with a
particular name." In that case then I think you are golden. If there
is a chance that the element itself is a div1 element, then you will
want to use ancestor-or-self instead, but otherwise I think you have
it right.