Merge "Account for children margins when orienting popup container." into sc-dev