Would it be a bad situation for a child if both the parents have major depression, even before the child is born?

Yes, but... While that would increase the chances of the child eventually developing depression, if both parents get good and thorough treatment before the child is born, they will be better able to raise the child. And they will be able to teach the child about what to watch for as early signs and what to do to prevent it. Also, the child will inherit positive traits, such as intelligence or other skills too.