newer fix computes positions upwards in a dom tree