Fix position instability around highlighted annotations

By checking only nodes that pass the supplied node filter, the position
logic can safely ignore out-of-place cursors near highlighted annotations.

Note, this can't re-use PositionIterator.previousNode, because the logic
requires the previous node of the current container's *parent*.