I really don't like sound of "first valid parent" that's why I was suggesting to use "most appropriate" instead, because this gives us more flexibility in choosing what makes sense rather than what's first even though in practice it very well may be first valid option. Also noting and providing example showing how this is used to handle platform differences would be very useful.