Here is my advice to anyone, particularly in this market: when you accept an offer, don't quit. Do not quit until you've started at the new company. Before you start they can just rescind the offer. After you start they need to fire you.
Remember you can just quit with no notice from your old employer. Is it ideal? No. But a lot of employers will have you doing nothing the last 2 weeks anyway. It'll just be handing off stuff and twiddling your thumbs.
But most importantly, the company won't hesitate to rescind an offer or fire you for reasons that have nothing to do with you, even when doing so puts you in an extremely precarious situation (eg you may lose your work visa and have to leave the country).
The company isn't your friend. it's a business and you have a business relationship. You're just terminating it, just like they can and do.