Bug 829921 - Make sure that we don't choose a reference frame that is an ancestor of the root reference frame. r=roc a=bajaj