Use container instead of parent for tooltip/popover auto-placement calcs

Fixes #14561.